我有以下错误:
zone.js@0.7.4:405 Unhandled Promise rejection: Cannot read property 'visitExpression' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'visitExpression' of undefined
我正在尝试按照本教程进行操作,最后我甚至从原始文件中复制并粘贴了完整的.TS文件。 教程: https://angular.io/tutorial/toh-pt5
完整的原始资源文件: https://embed.plnkr.co/?show=preview
但是我仍然有同样的错误:
根据其他人遇到类似问题,看起来错误可能在路由模块中,但我在这里找不到任何语法错误
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from './dashboard.component';
import { HeroesComponent } from './heroes.component';
import { HeroDetailComponent } from './hero-detail.component';
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'detail/:id', component: HeroDetailComponent },
{ path: 'heroes', component: HeroesComponent }
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {}