acz
acz

Reputation: 97

Listening for change in active tab

Using Angular UI tabs. I want to know when the active tab is changed. How can I do this?

I tried adding a ng-click attribute to my tabs, but it only procs when I actually click tabs - when I change the .active tab in my code, the ng-click isn't called.

Thanks!

Upvotes: 0

Views: 116

Answers (1)

Arkantos
Arkantos

Reputation: 6608

You need to use deselect() on tab element as mentioned in the Angular-UI docs here

select()  : An optional expression called when tab is activated.
deselect() : An optional expression called when tab is deactivated.

Here's a pen to illustrate the idea. Hope that helps :)

Upvotes: 1

Related Questions