Why is `replace` property deprecated in AngularJS directives? [duplicate]

UPDATE

One of the collaborators has said it won’t be removed, but known bugs will not be fixed.
https://github.com/angular/angular.js/commit/eec6394a342fb92fba5270eee11c83f1d895e9fb#commitcomment-8124407

ORIGINAL

Here is the commit of this change:
https://github.com/angular/angular.js/commit/eec6394a342fb92fba5270eee11c83f1d895e9fb

The replace flag for defining directives that replace the element
that they are on will be removed in the next major angular version.
This feature has difficult semantics (e.g. how attributes are merged)
and leads to more problems compared to what it solves. Also, with
WebComponents it is normal to have custom elements in the DOM.

It sounds to me like its a combination of complexity vs benefit to maintain support.

And apparently one reason dev were using it because they prefered semantically correct markup to be injected , thus replacing the custom directive tag.


Read the comments lower down on that link and apparently many people want it to stay.

Leave a Comment