Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closable tabs in Angular material

I've been fiddling with Angular-Material and it does seem pretty slick. One of the issues though, that we're having is the lack of the ability to close a tab using an 'X' button next to the tab's label. This is similar to what any browser tab UI will have to offer. In the current UI framework we use (Angular Bootstrap UI) you could define the rendering of the tab header to add such a button. Any ideas on how to implement it with Material's md-tab directive?

Thanks.

like image 783
Gabriel Kohen Avatar asked Mar 18 '23 02:03

Gabriel Kohen


1 Answers

The docs at: https://material.angularjs.org/#/api/material.components.tabs/directive/mdTab

Say:

If the label attribute is not specified, then an optional tag can be used to specify more complex tab header markup. If neither the label nor the md-tab-label are specified, then the nested markup of the is used as the tab header markup.

Why not define your in a tag?

like image 187
Rene M. Avatar answered Apr 01 '23 07:04

Rene M.