$animate.leave causes IE error if raw DOM element passed #15081
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Calling $animate.leave()
with a raw DOM element as parameter will cause an Object doesn't support property or method remove
error in IE 10/11.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
let ele = $document[0].getElementById('some-id')
$animate.leave(ele);
What is the expected behavior?
It works in other browsers, because they support the DOM element .remove()
method. However, as this is not supported in IE, I would think that Angular should check if the object passed into the function is in fact a jQlite wrapped object or a raw DOM element, and give a warning if it's not a jQlite wrapped object or possibly wrap it by itself.
What is the motivation / use case for changing the behavior?
Warn developers of potential problems in IE.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Angular 1.5.8
IE 10, 11
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The following line is what's causing it:
Line 509 in 0ff10e1