-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$compile: error while removing tAttr with interpolated expression during directive compile #9236
Comments
you'd have to remove the attributes observer (and ideally the watcher associated with it). There is no public API to do this yet really, although it doesn't seem unreasonable |
@caitp I think that the issue is talking about removing the interpolation before AttrInterpolateDirective reaches |
Handle the removal of an interpolated attribute before the attrubute interpolating directive is linked Closes angular#9236
Handle the removal of an interpolated attribute before the attribute interpolating directive is linked Closes angular#9236
@g00fy- not sure how both issues are related, one is about handling the removal of an attribute that is going to be interpolated and the other is about removing an element during |
dealing with the compile case doesnt really need any special treatment, however after link it does |
@caitp there are two cases here
|
Compile doesn't really need any special treatment lgalfaso, you can just |
It would be even more trivial if we added a method like |
@caitp I agree that a richer API for Attribute can solve this. Now, I still think we have two cases. For the former, we already have code and tests that are able to handle the case of the attribute being changed between compile and link, and we do not handle the removal of the attribute. About the later case, I do not know if we want to add support for it |
the only reason it's still a problem is because they're still iterating over that key --- but if you delete the key rather than setting it to null, the problem stops |
Handle the removal of an interpolated attribute before the attribute interpolating directive is linked Closes angular#9236 Closes angular#9240
According to : these lines calling
Should remove the
Attribute
from the element.This does not work with
tAttrs
containing interpolated expressions<h1 foo="{{bar}}">Hello</h1>
.How to replicate
See example
code:
currently quick fix for apps (imho similar fix can be applied to angular Attributes + check if they contain interpolated expression):
This issue questions timing of registering interpolations (before or after compilation ?) - this should be mentioned in the docs.
The text was updated successfully, but these errors were encountered: