File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ function $InterpolateProvider() {
202
202
}
203
203
exp = text . substring ( startIndex + startSymbolLength , endIndex ) ;
204
204
expressions . push ( exp ) ;
205
- parseFns . push ( $parse ( exp , parseStringifyInterceptor ) ) ;
205
+ parseFns . push ( $parse ( exp ) ) ;
206
206
index = endIndex + endSymbolLength ;
207
207
expressionPositions . push ( concat . length ) ;
208
208
concat . push ( '' ) ;
@@ -232,7 +232,7 @@ function $InterpolateProvider() {
232
232
var compute = function ( values ) {
233
233
for ( var i = 0 , ii = expressions . length ; i < ii ; i ++ ) {
234
234
if ( allOrNothing && isUndefined ( values [ i ] ) ) return ;
235
- concat [ expressionPositions [ i ] ] = values [ i ] ;
235
+ concat [ expressionPositions [ i ] ] = parseStringifyValue ( values [ i ] ) ;
236
236
}
237
237
return concat . join ( '' ) ;
238
238
} ;
@@ -299,7 +299,7 @@ function $InterpolateProvider() {
299
299
replace ( escapedEndRegexp , endSymbol ) ;
300
300
}
301
301
302
- function parseStringifyInterceptor ( value ) {
302
+ function parseStringifyValue ( value ) {
303
303
try {
304
304
return stringify ( getValue ( value ) ) ;
305
305
} catch ( err ) {
Original file line number Diff line number Diff line change @@ -1253,13 +1253,21 @@ function $ParseProvider() {
1253
1253
1254
1254
function addInterceptor ( parsedExpression , interceptorFn ) {
1255
1255
if ( ! interceptorFn ) return parsedExpression ;
1256
+ var watchDelegate = parsedExpression . $$watchDelegate ;
1256
1257
1257
- var fn = function interceptedExpression ( scope , locals ) {
1258
+ var regularWatch =
1259
+ watchDelegate !== oneTimeLiteralWatchDelegate &&
1260
+ watchDelegate !== oneTimeWatchDelegate ;
1261
+
1262
+ var fn = regularWatch ? function regularInterceptedExpression ( scope , locals ) {
1263
+ var value = parsedExpression ( scope , locals ) ;
1264
+ return interceptorFn ( value , scope , locals ) ;
1265
+ } : function oneTimeInterceptedExpression ( scope , locals ) {
1258
1266
var value = parsedExpression ( scope , locals ) ;
1259
1267
var result = interceptorFn ( value , scope , locals ) ;
1260
1268
// we only return the interceptor's result if the
1261
1269
// initial value is defined (for bind-once)
1262
- return isDefined ( value ) || interceptorFn . $stateful ? result : value ;
1270
+ return isDefined ( value ) ? result : value ;
1263
1271
} ;
1264
1272
1265
1273
// Propagate $$watchDelegates other then inputsWatchDelegate
You can’t perform that action at this time.
0 commit comments