Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-tab md-on-select doesn't work properly with ng-repeat #2600

Closed
hanthomas opened this issue Apr 28, 2015 · 1 comment
Closed

md-tab md-on-select doesn't work properly with ng-repeat #2600

hanthomas opened this issue Apr 28, 2015 · 1 comment

Comments

@hanthomas
Copy link

The following plunkr demonstrates the problem:

http://plnkr.co/edit/c4Qmb5RBdH4jAHbR9ET6?p=preview

As you can see from the demo, the tab is generated correctly. But, the expression evaluated in md-on-selected doesn't recognize the tab parameter.

@jo-me
Copy link

jo-me commented Apr 29, 2015

I can confirm this. Upgraded from 0.83 to 0.9 RC3 today and found this not working at all.

I debugged a little in the sources and found that the expressions given in md-on-select/deselect are executed in the wrong scope. It is executed agains the md-tabs parent scope which does not know anything about the scope created by ng-repeat on md-tab level.

So instead of evaluating the md-select expression against the md-tabs scope it has to be executed against the individual tab's scope (or parent scope, which would be the scope created by ng-repeat).

The offending commit is this one:
02a4af5#comments

In addition to the behavior above, I'm also missing the very first tab select event after the ng-repeat has been executed. The method calling the select/deselect functions is only called when the tab list is still empty and not when it is has been populated by ng-repeat.

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

No branches or pull requests

2 participants