This package has been deprecated

Author message:

This package will no longer be maintained.

middleout-ng-acl

1.0.2 • Public • Published

Middleout Angular Router

Resolves no longer accept functions. Instead, they require a string. The string is the name of the service to inject. That service must have a method called "invoke()" which must return a promise if you want to wait for it to respond.

Optionally you can type "SomeService@SomeMethod" to run the SomeMethod instead.

The documentation is that from ngRoute. The only difference is the resolve system and the nested routes.

The resolve services receive the route and params.

The resolve services do not act as a middleware(!). Instead they are all fired at the same time and do not know about each other.

Install

npm install middleout-ng-router

Usage

require('angular');
var Router = require('middleout-ng-router');
 
app.config(function(RouterProvider){
    Router.init({
      "routes": {
        "base": {
          "resolve": {
            "auth": "SomeAuthService@CheckAuthBeforeAnyRouteIsMatched"
          },
          "url": "/"
        },
        "base.locale": {
          "url": "/:locale",
          "controller": "SomeController",
          "templateUrl": "someView"
        },
        "base.locale.not-found": {
          "url": "/not-found",
          "controller": "PageNotFoundCtrl",
          "template": "inline template"
        }
      }
    });
    Router.otherwise('/not-found');
})

License

Apache 2

Dependents (0)

Package Sidebar

Install

npm i middleout-ng-acl

Weekly Downloads

3

Version

1.0.2

License

none

Last publish

Collaborators

  • andrei.gabreanu