Guest User

Untitled

a guest
Feb 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. this.router.navigate(
  2. [`/tickets/buy`],
  3. {
  4. queryParams: {
  5. event: event.id
  6. }
  7. }
  8. )
  9.  
  10. constructor(private router: Router) {}
  11.  
  12. public navigateWithSomeState(): void {
  13. this.router.navigateByUrl('/tickets/buy', {
  14. state: что угодно
  15. });
  16. }
  17.  
  18. class BuyTicketsComponent {
  19. constructor(router: Router) {
  20. console.log(router.getCurrentNavigation().extras.state);
  21. }
  22. }
Add Comment
Please, Sign In to add comment