-
Notifications
You must be signed in to change notification settings - Fork 27.3k
fix(compile): Interpolate @ locals before the link function runs #1555
fix(compile): Interpolate @ locals before the link function runs #1555
Conversation
This is a rebased version of #1488 |
Also, the addAttrInterpolateDirective should also initialize the value of an interpolated attribute to ensure that it is available to link functions of custom directives. |
Thread on the mailing relating to this: https://groups.google.com/d/topic/angular/Np7WX0_3aYA/discussion |
Do a one-off interpolation of @ locals to ensure that the link fn receives attributes that are already interpolated.
A bug report related to this one: #1752 (I'm sure that there are more). |
Current behavior seems to be really a bit confusing for people: http://stackoverflow.com/q/14552024/1418796 |
Not much we can do, since we really do have to wait for the first digest to On 27 January 2013 20:58, Pawel Kozlowski notifications@github.com wrote:
|
MERGED |
@mhevery - I thought you decided this was bad juju? |
we looked at it again and decided that the harm caused by not merging this is bigger than the confusion that is caused by the issue being fixed. |
was it actually fixed? I am still having the same issue with the latest angular.. |
I think not. Just remember to either $observe the attribute or to manually On 18 July 2013 01:03, ideaocean notifications@github.com wrote:
|
It seems to be fixed with 1.1.5, e.g for locals myattr="Test" and for bindings myattr={{controllerPropertyHere}} work. However attr="controllerPropertyHere" doesn't work though which is not a major drawback problem. Without this fix, we had to deal with watch expressions and so on which are confusing and complicated compared to this approach. |
Do a one-off interpolation of @ locals to ensure that the link fn receives attributes that are already interpolated.
(Rebased and reworded the commit message to make it easier to merge!)