npm

angular-global-resolve

1.1.0 • Public • Published

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)

Readme

Keywords

none

Package Sidebar

Install

npm i angular-global-resolve

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • v1per