【发布时间】:2017-05-09 14:53:30
【问题描述】:
异常:未捕获(在承诺中):错误:./e 类 e 中的错误 - 内联模板:9:6 导致:对象取消订阅 错误:./e 类 e 中的错误 - 内联模板:9:6 导致:对象取消订阅 在 ViewWrappedError.ZoneAwareError (http://localhost:3000/node_modules/zone.js/dist/zone.js:811:33)
// aap.component.ts
import { Component } from '@angular/core';
// import { LocalStorageService } from 'angular-2-local-storage';
@Component({
moduleId: module.id,
selector: 'my-app',
template: `
<div class="container">
<div class="punjab-vehicle-wrapper">
<div class="punjab-vehicle">
<a routerLink="/province" routerLinkActive="active" > Province Vehicle Verification </a>
<a routerLink="/capital"> Capital Vehicle Verification </a>
</div>
</div>
</div>
<router-outlet></router-outlet>
`
})
export class AppComponent{
}
//路由模块
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
// loading _component
import { VehicleComponent } from './vehicle.component';
import { AppComponent } from './app.component';
import { IslamVehicleComponent } from './islam-vehicle.component';
const routes: Routes = [
// { path: 'main', component: AppComponent },
// { path: '', redirectTo: '/punjab', pathMatch: 'full'},
{ path: 'province', component: VehicleComponent },
{ path: 'capital', component: IslamVehicleComponent }
];
@NgModule({
imports: [
RouterModule.forRoot(routes)
],
exports: [
RouterModule
]
})
export class VehicleRoutingModule{
}
不知道是哪个文件错误,
【问题讨论】:
-
给我们看一些代码,很难调试空气...