Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Tab select/deselect methods should pass reference to tab #3826

Closed
viveleroi opened this issue Jun 16, 2015 · 2 comments
Closed

Tab select/deselect methods should pass reference to tab #3826

viveleroi opened this issue Jun 16, 2015 · 2 comments

Comments

@viveleroi
Copy link

Currently, the tabset directive allows us to define select/deselect callbacks select="tabChange(). However, there's nothing on the scope that can be easily passed as an argument which references the tab.

What I'd like to see is something along the lines of:

select="tabChange($tab)"

Where $tab is the tab object with active, heading, and other properties. This is especially useful for those not using an ng-repeat to generate tabs.

@wesleycho
Copy link
Contributor

Closing in favor of #4836 - keep an eye on that issue

@asgh
Copy link

asgh commented Aug 9, 2016

I don't know if there is a better way, but this worked for me:

....deselect="func($event, $selectedIndex, this)">

And the javascript:

....function($event, $selectedIndex, caller) {
  caller.$parent.tabset.active = $selectedIndex;
}

You can get a reference to the tabset, not the tab. But you can look at active to find the tab, and $selectedIndex to find the new tab.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants