angular-global-resolve
v1.1.0
Published
Resolve common dependencies for routes
Downloads
7
Readme
What
Resolve common dependencies for routes
Install
$ npm install --save angular-global-resolve
Usage
angular
.module('app', [
require('angular-global-resolve')
])
angular
.module('expenses', [])
.config(routes)
function routes($stateProvider, globalResolveProvider) {
globalResolveProvider.addGlobalDependencies($stateProvider, {
user: function (userService) {
'ngInject';
return userService.getUser();
}
});
}
NOTICE:
You can use either $stateProvider (ui-router) and $routeProvider (ngRoute)