How do you pass data through routing in angular ?

Send

constructor(public router: Router}

this.router.navigate(['action'], { state: { data: 'bar' } });

Receive:

console.log(history.state);

//output 
{data: "234", navigationId: 3}
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments