是否可以在canActivate防护中访问路径(-Resolver)的已解析数据.目前我可以通过访问组件中已解析的数据
ngOnInit() { this.route.data .subscribe((data: { example: Array<Object> }) => { this.example = data.example; console.log('example resolver',this.example); }); }
我怎么能在canActivate后卫中管理它?这不起作用:
constructor(private route: ActivatedRoute) {} canActivate( route: ActivatedRouteSnapshot,state: RouterStateSnapshot,): boolean { this.route.data .subscribe((data: { example: Array<Object> }) => { this.example = data.example; console.log('example resolver',this.example); }); }