-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Angular 1.2: Using "terminal" on a directive breaks the interpolation on attrs.$observe #4525
Comments
I was playing around with priority and found that interpolation works with any priority less than -99. So with priority -100 the value is interpolated, with -99 it isn't. Not sure what's going on there... |
Must be this: Line 1354 in 63c5334
|
Maybe this isn't a bug? I can workaround by changing the priority, feel free to triage however you like. |
Having the same issue with last stable version (1.0.8). I have an expression with curly braces within ng-click directive, that makes the ng-click not to be called:
|
This is a different issue. Attributes are generally either evaluated or interpolated -- ng-click is evaluated, not interpolated, so curly braces aren't treated special. You can try:
|
I think this is working as intended. If you say a directive is terminal, and it has a higher priority than other directives on the same element, I would expect those directives not to be invoked by |
…rectives Recently we changed the priority of attribute interpolation directive to -100 to ensure that it executes early in the post linking phase. This causes issues with when terminal directives are placed on elements with attribute bindings because the terminal directive will usually have 0 or higher priority which results in attr interpolation directive not being applied to the element. To fix this issue I'm switching the priority back to 100 and making moving the binding setup into the pre-linking function. This means that: - terminal directives with priority lower than 100 will not affect the attribute binding - if a directive wants to add or alter bindings it can do so in the pre-linking phase, as long as the priority of this directive is more than 100 - all post-linking functions will execute after the attribute binding has been set up - all pre-linking functions with directive priority lower than 100 will execute after the attribute bindings have been setup BREAKING CHANGE: the attribute interpolation (binding) executes as a directive with priority 100 and the binding is set up in the pre-linking phase. It used to be that the priority was -100 in rc.2 (100 before rc.2) and that the binding was setup in the post-linking phase. Closes angular#4525 Closes angular#4528 Closes angular#4649
…rectives Recently we changed the priority of attribute interpolation directive to -100 to ensure that it executes early in the post linking phase. This causes issues with when terminal directives are placed on elements with attribute bindings because the terminal directive will usually have 0 or higher priority which results in attr interpolation directive not being applied to the element. To fix this issue I'm switching the priority back to 100 and making moving the binding setup into the pre-linking function. This means that: - terminal directives with priority lower than 100 will not affect the attribute binding - if a directive wants to add or alter bindings it can do so in the pre-linking phase, as long as the priority of this directive is more than 100 - all post-linking functions will execute after the attribute binding has been set up - all pre-linking functions with directive priority lower than 100 will execute after the attribute bindings have been setup BREAKING CHANGE: the attribute interpolation (binding) executes as a directive with priority 100 and the binding is set up in the pre-linking phase. It used to be that the priority was -100 in rc.2 (100 before rc.2) and that the binding was setup in the post-linking phase. Closes angular#4525 Closes angular#4528 Closes angular#4649
Here's an example using Angular 1.2 RC3:
http://plnkr.co/edit/LMF2YuJW1Opj9gS3wv63?p=preview
If you open the JS console you can see what the observed value is. It's uninterpolated with its curly braces still intact.
Here's the same code running on Angular 1.0.8 that works correctly:
http://plnkr.co/edit/E0vINw7Pyjk0G2I1UwBI?p=preview
The text was updated successfully, but these errors were encountered: