Pass data in Angular router dynamically

前端 未结 2 1227
闹比i
闹比i 2021-01-27 23:37

I am trying to send data(Object) from one component to another however I am getting an empty result.

Here is my code

routing module

2条回答
  •  醉话见心
    2021-01-28 00:16

    set the caseData inside the subscribe method

    this.route
     .data
     .subscribe(v => {
       this.caseData = v;
       console.log(this.caseData) 
    });
    

提交回复
热议问题