lordfriend / ng-forward-router

[DEPRECATED]A plugin for ng-forward which implements a decorator of ui-router

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#ng-forward-router

A plugin for ng-forward which enables using ui-router with decorator

DEPRECATED ngForward has already added a @StateConfig decorator in current release. It is suggested using the build-in @StateConfig of ngForward.

##Usage

import {bootstrap, StateConfig} from 'ng-forward-router';

// define state config just like ui-router,
// but you don't need to specify the controller property,
// StateConfig decorator will bind the controller with the decorated class
// if you don't specify the controllerAs property, 'vm' will be used as default
@StateConfig('main', {
    url: '/main'
    template: '<example></example>'
}
@Inject('SomeService')
class MainCtrl {
    constructor(SomeService) {
        this.someValue = SomeService();
    }
}

// bootstrap angular app using the bootstrap method from ng-forward-router instead of ng-forward.

bootstrap(MainCtrl);

About

[DEPRECATED]A plugin for ng-forward which implements a decorator of ui-router


Languages

Language:TypeScript 54.0%Language:JavaScript 46.0%