1

I can only find examples which using typescript. I have tried nesting ng.Router.RouteConfig with the ng.core.Component.

(function(app) {

app.AppComponent = ng.core.Component({

    selector: "my-app",
    directives: [ng.router.RouterLink, ng.router.RouterOutlet],
    template: '<h1>Loading</h1>'

}).Class({

    constructor: function() {

    }
}).ng.router.RouteConfig([{
    path: '/',
    redirectTo: ['/index.html'],
    path: '/home',
    component: app.HomeCmp,
    as: 'Home'
}])

})(window.app || (window.app = {}));

it doesn't work and i dont know how to and where to import the route related directives.

Does any one know how to do it using javascript?

1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.