Noah's Pairwise Manifest
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    middleout-ng-aclpublic

    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

    Keywords

    none

    install

    npm i middleout-ng-acl

    Downloadsweekly downloads

    0

    version

    1.0.2

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar