Hll*_*ink 3 angular2-routing angular
我正在按照有角度的2路线指南
import { Routes, RouterModule } from '@angular/router';
import { FooComponent } from './component/foo.component';
const fooRoutes: Routes = [
{ path: 'foopath', component: FooComponent },
];
export const fooRouting = RouterModule.forChild(fooRoutes);
Run Code Online (Sandbox Code Playgroud)
在visual studio代码中我有以下错误:
任何人都可以告诉我为什么会这样吗?这与官方指南完全相同.我正在使用Angular 2 RC5.
Ksh*_*tij 20
你应该添加 import { ModuleWithProviders} from '@angular/core';
有关参考,请参阅ModuleWithProviders文档.