-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Double compiling #15278
Comments
Re-compiling an already compiled element is not supported (and can lead to all sorts of problems, including memory leaks). What you can do instead, is specify a high-priority, terminal directive, switch the attributes and then continue the compilation starting from your directive's priority. See #15270 (comment) for more details on how you can do this. |
It is not a solution. The troubles is only in |
Not sure what you mean 😕 |
Here you have an JSFiddle example. Update with your suggestion and share what you are exactly recommending, please. The problem is 2 console logs on one click. |
The priority on your directive override for For more info, see the usage section here: https://docs.angularjs.org/api/ng/service/$compile |
Fixed your jsFiddle |
Nice! It is running well! Take updated JSFiddle example. Thanks! |
The solution is fantastic, but there is a problem with |
@Miqueliu, I'd be glad to take a look at it, but this isn't really the place for debugging. Unless you think this is actually a bug in the framework (which I don't think it is, I think it's something about the transclusion) you should do a stack overflow. |
Ok. I will. Thank you. |
In Stack Overflow, it is said that the ngRepeat directives conflict against |
I want that any element with
title
attribute behaves like anuibTooltip
atribute (from UI Bootstrap module). So, I created a simple directive that automatically puts this atribute and removes that other one, like this:It converts the attributes and then it compiles again.
The problem appears, for example, in this element (in Bootstrap design):
With appropriate controller:
Since it recompiles,
ngClick
function executes twice on click.Which is the way for change element's attributes before compilation?
The text was updated successfully, but these errors were encountered: