Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 错误类型错误:无法读取属性';标签';未定义角的_Angular_Typescript_Rxjs - Fatal编程技术网

Angular 错误类型错误:无法读取属性';标签';未定义角的

Angular 错误类型错误:无法读取属性';标签';未定义角的,angular,typescript,rxjs,Angular,Typescript,Rxjs,MemberDetailedComponent @ViewChild('memberTabs', { static: false }) memberTabs: TabsetComponent; ngOnInit() { /* get thr routes tab parameter */ this.route.queryParams.subscribe(params => { // tslint:disable-next-line: no-string-lite

MemberDetailedComponent

@ViewChild('memberTabs', { static: false }) memberTabs: TabsetComponent;
ngOnInit() {
    /* get thr routes tab parameter */
    this.route.queryParams.subscribe(params => {
      // tslint:disable-next-line: no-string-literal
      const selectTab = +params['tab'];
      console.log('queryparams:' + selectTab);
      this.memberTabs.tabs[selectTab > 0 ? selectTab : 0].active = true;
    });
}
在routerlink中

[routerLink]="['/members']"[queryParams]="{ tab: 3 }"

虽然selectTab读取该值,但控制台显示未定义的选项卡将
{static:false}
替换为
{static:true}

您的路由是什么样子的?请注意
成员选项卡在
Ngoniit
生命周期挂钩中未定义。使用
ngAfterViewInit
[routerLink]="['/members']"[queryParams]="{ tab: 3 }"