SIGN IN SIGN UP
angular / angular.js UNCLAIMED

AngularJS - HTML enhanced for web apps!

0 0 0 JavaScript

fix(jqLite): make removeData() not remove event handlers

This change aligns jqLite with jQuery.

Fixes #15869
Closes #16512

BREAKING CHANGE:

Before this commit `removeData()` invoked on an element removed its event
handlers as well. If you want to trigger a full cleanup of an element, change:

```js
elem.removeData();
```

to:

```js
angular.element.cleanData(elem);
```

In most cases, though, cleaning up after an element is supposed to be done
only when it's removed from the DOM as well; in such cases the following:

```js
elem.remove();
```

will remove event handlers as well.
M
Michał Gołębiowski-Owczarek committed
b7d396b8b6e8f27a1f4556d58fc903321e8d532a
Parent: 71d2c14
Committed by GitHub <noreply@github.com> on 4/3/2018, 7:49:52 PM