aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/compile.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2012-10-24 11:06:36 +0100
committerMisko Hevery2013-02-14 21:36:59 -0800
commit2ed53087d7dd06d728e333a449265f7685275548 (patch)
treeac6c1782b17ea9f86408db78740e39cef8eef0dc /src/ng/compile.js
parent0af172040e03811c59d01682968241e3df226774 (diff)
downloadangular.js-2ed53087d7dd06d728e333a449265f7685275548.tar.bz2
fix(compile): Interpolate @ locals before the link function runs
Do a one-off interpolation of @ locals to ensure that the link fn receives attributes that are already interpolated.
Diffstat (limited to 'src/ng/compile.js')
-rw-r--r--src/ng/compile.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index 18adc2c9..32c1d1ca 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -735,9 +735,13 @@ function $CompileProvider($provide) {
scope[scopeName] = value;
});
attrs.$$observers[attrName].$$scope = parentScope;
+ if( attrs[attrName] ) {
+ // If the attribute has been provided then we trigger an interpolation to ensure the value is there for use in the link fn
+ scope[scopeName] = $interpolate(attrs[attrName])(parentScope);
+ }
break;
}
-
+
case '=': {
parentGet = $parse(attrs[attrName]);
parentSet = parentGet.assign || function() {