-
Notifications
You must be signed in to change notification settings - Fork 27.5k
TypeError in animateSetup on deletion of repeated element when using ng-include #4871
Comments
I used the solution I mentioned above. The exception is not thrown, however it looks like 'leave' animations do not work. I suspect they may not worked in the first place for this particular case.
Here's working plunkr with the fix applied I can create a pull request with this simple change, if this is what we want here (get rid of the error), but leave the 'leave' animations not working in this case. Perhaps we need to open another issue for it. |
Fix TypeError in animateSetup on deletion of repeated element when using ng-include. Added nodeType check to ensure we operate on element node. Closes angular#4871
@GregorL thank you for the commit, but this issue spans across all of This will show up in 1.2.4. Thanks a bunch. |
Sure, I imagined the problem might be in more than one place. I'm glad it is fixed. Thanks! |
Ah right. Didn't notice that. It looks like both ngInclude and ngRepeat are competing for who gets to animate the leave operation. Normally this isn't a problem, but when a destructive DOM operation happens which removes the element before the next animation takes place, then this leads up to the next animation having no element to perform the animation on. Please open an issue and mention me in there so I can make a new fix for that. |
…ansclusion Closes angular#4716 Closes angular#4871 Closes angular#5021 Closes angular#5278
…ansclusion Closes angular#4716 Closes angular#4871 Closes angular#5021 Closes angular#5278
…ansclusion Closes angular#4716 Closes angular#4871 Closes angular#5021 Closes angular#5278
Plunkr: http://plnkr.co/edit/qMFvUdi1D5JQ8yEzSWvc?p=preview
The error occurs on click on one of the "Remove this" links.
I attach stack trace just in case.
TypeError: Cannot set property 'transitionProperty' of undefined
at animateSetup (http://code.angularjs.org/1.2.0/angular-animate.js:976:54)
at animateBefore (http://code.angularjs.org/1.2.0/angular-animate.js:1092:12)
at animate (http://code.angularjs.org/1.2.0/angular-animate.js:1112:37)
at Object.angular.module.config.$animateProvider.register.leave as before
at http://code.angularjs.org/1.2.0/angular-animate.js:680:33
at Array.forEach (native)
at q (http://code.angularjs.org/1.2.0/angular.min.js:7:261)
at invokeRegisteredAnimationFns (http://code.angularjs.org/1.2.0/angular-animate.js:665:11)
at performAnimation (http://code.angularjs.org/1.2.0/angular-animate.js:643:9)
at http://code.angularjs.org/1.2.0/angular-animate.js:394:13
This is very similar to #4548 .
The 'node' variable should be checked if its 'nodeType' property equals 1 (ELEMENT_NODE constant). Currently, it blows up because the node is a comment element in this case and does not have property 'style'.
The text was updated successfully, but these errors were encountered: