title: angular 5 routing to same component but different param, not working
body: <p>I have angular 5 basic beginner level app
  there are just 5 components</p>
  
  <p>my routing and links look like this</p>
  
  <pre><code>//copied from app.module.ts
  const appRoutes:Routes = [
    {path:'',component:HomeComponent},
    {path:'items/:cat',component:ItemsComponent},
    {path:'itemdetail/:id',component:ItemdetailComponent},
    {path:'settings',component:SettingsComponent},
  ];
  
  //copied from navbar.component.html
  &lt;ul&gt;
        &lt;li&gt;&lt;a [routerLink]="['/']"&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a [routerLink]="['/items/8']"&gt;Rashion&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a [routerLink]="['/items/2']"&gt;Vegitables&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a [routerLink]="['/items/3']"&gt;Fruits&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a [routerLink]="['/items/7']"&gt;Other&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a [routerLink]="['/items/5']"&gt;Sweets&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a [routerLink]="['/settings']"&gt;Settings&lt;/a&gt;&lt;/li&gt;          
  &lt;/ul&gt;
  
  //copied from items.component.ts
  ngOnInit(){
      this.cat = this.route.snapshot.params['cat'];
      this.itemsSrv.getItems(this.cat)
              .subscribe((data)=&gt;{
                  this.items=data;
              });
  }
  </code></pre>
  
  <p>links only work if it is going to different component,<br>
  means I can navigate from home page to <code>/items/2</code><br>
  but when I am in items component I can navigate to <code>/items/any-parameter</code><br>
  although from Items i can go to home or settings component.<br>
  in short it is now working to navigate to same component even if parameter is different.
  <a href="https://i.stack.imgur.com/3YwE8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3YwE8.png" alt="enter image description here"></a></p>
  
  <p>I noticed one thing, URL is getting changed but page content is same as old page not reloading new url :(</p>