This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdTabs: always recompiling template on tab switch (scope/watchers leak) #3692
Labels
needs: demo
A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue
needs: investigation
The cause of this issue is not well understood and needs to be investigated by the team or community
needs: unit tests
This PR needs unit tests to cover the changes being proposed
type: bug
Milestone
Comments
I found a fix for this, at:
Needs to be changed to: scope.$on('$destroy', function(){
compileScope.$destroy();
}); Can someone familiar (@robertmesserle) with that code explain why the $destroy watcher would reconnect the scope? I see no unintended sideffects with the above code in my scenario, but I'm unsure what the intention was there. |
👍 |
@anderson-arlen - Have you tried to using the <md-tabs md-no-disconnect>
...
</md-tabs> And does this problem still exist with the latest code from master ? Please provide a CodePen or Plunkr that demonstrates this issue. Here are some starter demo templates that you can use/fork:
|
ThomasBurleson
added
type: bug
needs: demo
A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue
needs: tests
needs: investigation
The cause of this issue is not well understood and needs to be investigated by the team or community
labels
Jul 30, 2015
ThomasBurleson
changed the title
md-tabs always recompiling template on tab switch (scope/watchers leak)
mdTabs: always recompiling template on tab switch (scope/watchers leak)
Jul 30, 2015
@andreialecu, I think @ThomasBurleson meant to tag you instead of me. Pesky autocomplete... :D |
kennethcachia
pushed a commit
to kennethcachia/material
that referenced
this issue
Sep 23, 2015
This is necessary due to various bugs with disconnecting scope. The API remains the same for now, but in 0.11 we will revise the API's to more accurately describe what is going on under the hood. Closes angular#3692
Splaktar
added
the
needs: unit tests
This PR needs unit tests to cover the changes being proposed
label
Mar 5, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
needs: demo
A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue
needs: investigation
The cause of this issue is not well understood and needs to be investigated by the team or community
needs: unit tests
This PR needs unit tests to cover the changes being proposed
type: bug
I'm seeing a huge scope leak when switching through tabs with watchers on them.
I was able to track it down to this:
material/src/components/tabs/js/templateDirective.js
Line 35 in f5959cc
Always being called on switching the tab, and the whole directive re-running from the beginning. The disconnect() function is never called. This seems to create a new scope and compile the template every single time.
I suspect it is related to the performance related change that was made recently, where tab content is ng-if'd out when not active, but I'm not sure.
Related: #3508
The repro there can also be used to reproduce this problem.
The text was updated successfully, but these errors were encountered: