Skip to content

Commit 80eceb2

Browse files
committed
feat($interpolate): use custom toString member if present
BREAKING CHANGE: use custom toString implementation when present on object value types. Behavior is consistent with other implementations. Closes angular#7317
1 parent f684c21 commit 80eceb2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ng/interpolate.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ function $InterpolateProvider() {
272272
break;
273273
}
274274
default: {
275-
value = toJson(value);
275+
if(typeof value.toString !== 'undefined' && value != null && value.toString !== Object.prototype.toString && !isArray(value)) {
276+
value = value.toString();
277+
} else {
278+
value = toJson(value);
279+
}
276280
}
277281
}
278282

0 commit comments

Comments
 (0)