Angular 在控制台上获取错误数据

Angular 在控制台上获取错误数据,angular,Angular,我只是将一些数据作为url传递,并尝试从url在下一页上进行控制台操作。但获取错误变量中的数据 vendor-action.component.html 批准.component.ts 我在“col”中得到“rid”的值,“id”中得到“col”,在“rid”中得到“null”。 为什么会发生这种情况。这有什么问题吗?在路由信息中添加这3个变量如果发布路由配置会更好。您可以使用NavigationExtras。您不能像尝试的那样发送变量。 <tr mat-header-row *matHe

我只是将一些数据作为url传递,并尝试从url在下一页上进行控制台操作。但获取错误变量中的数据

vendor-action.component.html

批准.component.ts

我在“col”中得到“rid”的值,“id”中得到“col”,在“rid”中得到“null”。
为什么会发生这种情况。这有什么问题吗?

在路由信息中添加这3个变量

如果发布路由配置会更好。您可以使用NavigationExtras。您不能像尝试的那样发送变量。
<tr mat-header-row *matHeaderRowDef="['nVendorId','change_column','change_type','Timestamp','status','requestid']"></tr>
 <tr class="rowhover" (click)="displayData(row.change_column,row.nVendorId,row.requestid)" mat-row *matRowDef="let row; columns: ['nVendorId','change_column','change_type','Timestamp','status','requestid']"></tr>
displayData(col,id,rid)
{
 this.router.navigate(["/home/vendor-action/approval",col,id,rid]);
}
ngOnInit() 
  {
    this.col=this.activatedRoute.snapshot.paramMap.get('col');
    this.id=this.activatedRoute.snapshot.paramMap.get('id');
    this.rid=this.activatedRoute.snapshot.paramMap.get('rid');

    console.log(this.col);
    console.log(this.id);
    console.log(this.rid);
  }