Use method calls on click in material2 tabs and tab groups
See original GitHub issueQuestion (not an issue): In Bootstrap tabs we have this in our code:
<ul class="nav nav-tabs">
<li class="active"><a>Start</a></li>
<li><a (click)="viewmode.setMode1()">mode1</a></li>
<li><a (click)="viewmode.setMode2()">mode2</a></li>
</ul>
Now this is calling a utterly complicated hack where routing is accomplished with tampering URLs and parameters that I do not dare to touch. There is not much angularic about that code and I dont have time to change it. So I want to let the current strange routing in place, and need to trigger it with method calls from my tabs. Is this possible with material2 tabs?
e.g.:
<md-tab-group>
<md-tab (click)="viewmode.setMode1()" label="mode1">
<h1>Some tab content</h1>
<p>...</p>
</md-tab>
....
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to call a function when a tab is selected in Angular 4 Tabs?
You need to use the selectChange event: <md-tab-group (selectChange)= ...
Read more >Tabs - Angular Material
Recalculates the tab group's pagination dimensions. WARNING: Calling this method can be very costly in terms of performance. It should be called as ......
Read more >Share Tab Groups and collaborate in Safari on Mac
You can share a Tab Group and collaborate with people who use iCloud. ... In the Safari app on your Mac, click the...
Read more >PySimpleGUI
PySimpleGUI User's Manual. Python GUI For Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces. The Call Reference ...
Read more >Angular Material mat-tab-group - GeeksforGeeks
For this, we need to use a property called mat-align-tabs. If we want to change the theme then we can change it by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those considering the md-tab-nav-bar, be sure to check out 2177 first. It wraps on mobile and looks terrible today.
@andrewseguin is there a way to add click handlers to md-tabs like OP asked so I can make it work until the nav bar gets fixed?
Sounds like you want to look at the nav bar
See the bottom section of https://material.angular.io/components/component/tabs