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}

Leave a Reply

Your email address will not be published. Required fields are marked *