-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix(ngSwitch): not leak when transcluded and cloned #1793
Conversation
The leak can occur when ngSwich is used inside ngRepeat or any other directive which does not attached transcluded content to DOM but clones it. Refactor ngSwitch to use controller instead of storing data on compile node. Closes angular#1621
@danilsomsikov Nice work. I'm afraid that the unit test that you have provided doesn't actually do anything. |
It does. It reproduces situation when ngSwitch leaked. Te leak is being check at global afterEach in testabilityPatch.js On 11.01.2013, at 22:36, Pete Bacon Darwin [email protected] wrote:
|
Ahah! Sorry my mistake! On 11 January 2013 21:59, Danil Somsikov [email protected] wrote:
|
Jenkins build is good: On 11 January 2013 22:03, Peter Bacon Darwin [email protected] wrote:
|
I've signed the CLA. |
MERGED |
this landed as a692dd8 please note that I changed the commit slightly. while the test and fix were correct the info about the cause of the leak in the commit message was not. the leak was caused by the switch element not being attached during the destruction of the parent dom (during which we do cleanup). it had nothing to do with cloning of dom nodes. thanks for excellent work though! |
That's what I meant. Thanks for making it more clear! |
The leak can occur when ngSwich is used inside ngRepeat or any other
directive which does not attached transcluded content to DOM but clones
it.
Refactor ngSwitch to use controller instead of storing data on compile
node.
Closes #1621