File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1522,6 +1522,19 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1522
1522
linkFn ,
1523
1523
directiveValue ;
1524
1524
1525
+ // Helper/cache to $interpolate + evaluate a string while caching each $interpolate()
1526
+ function runInterpolate ( value , scope ) {
1527
+ var cache = runInterpolate . $$cache || ( runInterpolate . $$cache = createMap ( ) ) ;
1528
+ var interped ;
1529
+ if ( value in cache ) {
1530
+ interped = cache [ value ] ;
1531
+ } else {
1532
+ interped = cache [ value ] = $interpolate ( value , true ) ;
1533
+ }
1534
+
1535
+ return interped ? interped ( scope ) : value ;
1536
+ }
1537
+
1525
1538
// executes all directives on the current element
1526
1539
for ( var i = 0 , ii = directives . length ; i < ii ; i ++ ) {
1527
1540
directive = directives [ i ] ;
@@ -1857,7 +1870,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1857
1870
if ( attrs [ attrName ] ) {
1858
1871
// If the attribute has been provided then we trigger an interpolation to ensure
1859
1872
// the value is there for use in the link fn
1860
- isolateBindingContext [ scopeName ] = $interpolate ( attrs [ attrName ] ) ( scope ) ;
1873
+ isolateBindingContext [ scopeName ] = runInterpolate ( attrs [ attrName ] , scope ) ;
1861
1874
}
1862
1875
break ;
1863
1876
You can’t perform that action at this time.
0 commit comments