Thursday, April 11, 2019

Keep it inside the array in Angular 7. The freaks are part of the family now.

Assuming router below is an instance of Router from '@angular/router' then:

this.router.navigate(['/upload', {id:id}]);

 
 

...and...

router.navigate(['/upload','authenticated', {id:id}]);

 
 

...are really the way to bolt on stuff at the end of the URL to visit and not:

this.router.navigate(['/upload'], {id:id});

 
 

...and...

router.navigate(['/upload','authenticated'], {id:id});

 
 

I see the later approach in Angular 4 examples all over my own blog, but this is no longer the way things work.

No comments:

Post a Comment