Created
July 21, 2013 03:03
-
-
Save AnalogJ/6047309 to your computer and use it in GitHub Desktop.
AngularJS Dependency Injection for provider.
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('security.authorization', ['security.service']) | |
// You can add them as resolves to routes to require authorization levels | |
// before allowing a route change to complete | |
.provider('securityAuthorization', { | |
requireUser: ['securityAuthorization', function(securityAuthorization) { | |
return securityAuthorization.requireUser(); | |
}], | |
$get: ['security', 'securityRetryQueue', function(security, queue) { | |
var service = { | |
requireUser: function() { | |
//Stuff ... | |
return true; | |
}; | |
return service; | |
}] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment