why it is not navigating into another page in angular js

58 views Asked by At

I am try to navigate in another component using this.router.navigate with a id but it not giving error as well as it is not navigating ..

here is my code https://plnkr.co/edit/E6HCvkksFPt4mK4lN6mU?p=preview

moveToSecond(){
    alert('----')
    this.router.navigate(['/sd',{id:'ss'}]);
  } 
1

There are 1 answers

0
Pankaj Parkar On BEST ANSWER

For creating a desired URL, you have use below.

this.router.navigate(['/sd','ss']);

Forked Plunkr