-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Directives got duplicated after an $animate.enter since beta.5 #8895
Comments
@matsko any ideas? |
This looks like it's a bug with the compiler / interpolation code. The prepending causes it to somehow recompile itself and loose track of the node order. @tbosch can you have a look? |
yes, will do |
After reviewing this with @tbosch we believe that the example should not be supported, as changing DOM within controllers is strongly discouraged. If the animation logic in the example were moved to the directive's See updated example: http://plnkr.co/edit/KpFedIafuuPamEhtl5f0?p=preview |
Here is an updated plunker that shows the effect even without The call to Yes @jeffbcross is correct in saying that you should not modify the DOM in the controller, especially as the controller constructor function is called in the Closing this... |
@jeffbcross @tbosch The plunker is on a controller just for demo purposes. My real code is on a factory. It is a factory that generates directives (a factory to generate popup messages). There it happen too. Well, I will workaround then. |
Yes, but same reasoning there. You can also try to replace |
I got an issue where a directive was being created twice when I did some
$animation.enter
.The issue started on my repo: Foxandxss/angular-toastr#18 so I started researching about it and the change was on beta.5 (when
$animate.enter
started to prepend instead of append).I managed to reproduce it here: http://plnkr.co/edit/oYmXPIeN16g75a3kQJQc?p=preview
Starting from the console error (In my code I use
enter
like that and I get no error tho). Technically that shouldn't happen (I think).Leaving that aside, you can see the directive twice on screen. If you change
templateUrl
totemplate
it works (much like #6006).So I was wondering if I did wrong on the plunker (adding a third parameter resolves the issue) or there is a bug.
The text was updated successfully, but these errors were encountered: