当我尝试在项目中导入路由器类时,Plnkr失败
import {Component} from '@angular/core'
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router';
抛出以下错误:
VM883 zone.js:101GET https://npmcdn.com/@angular/src/directives/router_link_active
这是plnkr: http://plnkr.co/edit/9okaVfVSsRhPxexP9HNw?p=preview
答案 0 :(得分:0)
添加到您的systemjs配置以下内容:
'@angular/router': {
main: 'index.js',
defaultExtension: 'js'
}
<强> Plunker 强>
如果你想使用旧版本的路由器,那么:
'@angular/router-deprecated': {
main: 'index.js',
defaultExtension: 'js'
}
import { RouteConfig } from '@angular/router-deprecated';
<强> Plunker router deprecated 强>