angular2 javascript中的路由
我只能找到使用typescript的示例。 我已尝试将ng.Router.RouteConfig与ng.core.Component嵌套angular2 javascript中的路由,javascript,angular2-routing,Javascript,Angular2 Routing,我只能找到使用typescript的示例。 我已尝试将ng.Router.RouteConfig与ng.core.Component嵌套 (function(app) { app.AppComponent = ng.core.Component({ selector: "my-app", directives: [ng.router.RouterLink, ng.router.RouterOutlet], template: '<h1>Loading<
(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 = {}));
(功能(应用程序){
app.AppComponent=ng.core.Component({
选择器:“我的应用程序”,
指令:[ng.router.RouterLink,ng.router.RouterOutlet],
模板:“正在加载”
}).类({
构造函数:函数(){
}
}).ng.router.RouteConfig([{
路径:“/”,
重定向到:['/index.html'],
路径:'/home',
组件:app.HomeCmp,
比如:“家”
}])
})(window.app | |(window.app={}));
它不工作,我不知道如何以及在哪里导入路由相关指令
有人知道如何使用javascript吗?