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?