Reputation: 12015
I use Material Tabs in Angular 2.
How can I change the URL address when clicking on a tab. It is required for history navigation.
Upvotes: 0
Views: 2873
Reputation: 60357
When you use <md-tab-group>
, then tab changes are within the same route (=url). If you want the route(=url) to be changed when you click on a different tab, you should use <nav md-tab-nav-bar>
in combination with <router-outlet></router-outlet>
. This is agnostic to your app's router implementation. (So it works with the standard Angular router.) Read more about this in the official tabs documentation.
Upvotes: 2