Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

angular router.navigate pass data

//Send:
this.router.navigate(['action-selection'], { state: { example: 'bar' } });

//Receive:
constructor(private router: Router) {
  console.log(this.router.getCurrentNavigation().extras.state.example); // should log out 'bar'
}
 
PREVIOUS NEXT
Tagged: #angular #pass #data
ADD COMMENT
Topic
Name
8+1 =