https://angular.io/docs/ts/latest/guide/router.html
里是这样引入
import { provideRouter, RouterConfig } from '@angular/router';
但是在IDE里报错,模块没有这两个export,这个官方文档写错了?
阿神2017-05-15 17:04:48
There is nothing wrong with the document, it’s just a small oversight. The @angular/core
,@angular/common
都是2.0.0-rc.2
,所以你就以为也@angular/router
you quoted is also the same version, right?
But it’s actually @angular/router
是@3.0.0-alpha.3
(简直莫名其妙有没有!?)。不信你强制安装npm install @angular/router@3.0.0-alpha.7
in the official website documentation, then try again