The compiler adds the $watch method for watches the changes in the string.
If we want to use different beginning and ending symbols in our application for binding the string, we can modify them by configuring the $interpolateProvider.
The default symbol of expression is {{ (open curly braces) and }} (closing curly braces).
To modify the beginning string, we can set the starting symbol with the startSymbol() method.
To modify the ending string, we can set the ending symbol with the endSymbol() method.
Parameter value for $interpolate Service in AngularJS:
Value
Type
Description
text
string
The text with markup to interpolate.
mustHaveExpression(optional)
boolean
If set to true, then the interpolation string must have embedded expression in order to return an interpolation function. String with no embedded expression will return null for the interpolation function.
trustedContext(optional)
string
When provided, the returned function passes the interpolated result through $sce.getTrusted(interpolatedResult, trustedContext) before returning it.
allOrNothing(optional)
boolean
if true then the returned function returns undefined unless all embedded expressions evaluate to a value other than undefined.
$interpolateProvider configuration of Application Module.
var app= angular.module('myApp', [])app.config(function($interpolateProvider) {$interpolateProvider.startSymbol('-');$interpolateProvider.endSymbol('-');});
Code Explanation for $interpolateProvider in AngularJS: