Created
July 31, 2014 21:09
-
-
Save paulwsmith/42795a977fddbf3dcb16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('wizehive.services') | |
.service('PluginEvents', ['$rootScope', '$timeout', function($rootScope, $timeout) { | |
var scopes = { | |
// This would be set up dynamically, maybe by plugin directive? | |
'action-panel-top': $rootScope.$new(false), | |
'top-nav': $rootScope.$new(false) | |
}; | |
return function(location) { | |
// location = 'action-panel-top' | |
return { | |
$watch: function(expression, callback) { | |
scopes[location].$watch(expression, callback); | |
} | |
}; | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment