小编Kam*_*man的帖子

Angular 2 Uncaught(承诺):TypeError:无法读取未定义的属性'isActivated'

如果我返回到相同的路由路径,则会显示错误

"Uncaught(承诺):TypeError:无法读取未定义的属性'isActivated'".

但不是第一次出现.谁能帮我 ?

路由

const mainRoutes: Routes = [
    { path: '', pathMatch: 'full', redirectTo: '/home' },
    {
        path: 'home', loadChildren: './apps/home/home.module#HomeModule', canActivate: [AuthGuard],
        resolve: {
            crisis: NavigarionResolve
        }
    }
    { path: '**', component: PageNotFoundComponent }
];
Run Code Online (Sandbox Code Playgroud)

零件

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService }            from '../main/service/auth.service';

@Component({
  selector: 'home-app',
  templateUrl: 'apps/home/view/home.component.html',
  providers: [AuthService]
})

export class HomeComponent implements OnInit {
  loaded: boolean = false;
  title = 'Customer Management …
Run Code Online (Sandbox Code Playgroud)

angular2-template angular2-routing angular

10
推荐指数
1
解决办法
2684
查看次数