AngularJS $shared
AngularJS $shared
To make life easier for some AngularJS developers, they sometimes use the $rootScope to store data. To be fair, AngularJS scopes are a bit tricky at first and sometimes do not work according to plan. It is not a good idea to pollute the $rootScope and should only be used in certain scenarios. I decided to write a wrapper service / factory for this reason.

      $shared.set('someKey', 'hello!')

      $'someKey', function(newVal) {

      $shared.on($scope, "someSignal", function(event, data) {

      $shared.emit("someSignal", "someMessage");

The $shared factory / service is only around 50 lines of code but it includes some of the best practices and tweaks when using the $rootScope.

Source Code
You can view the source code here.