I am attempting to change the characters {
and }
in an HTML string to {{
and }}
. However, when using the replace function, I encounter the following error:
$scope.selectedtemplate.template.replace is not a function
Below is my code:
$scope.selectedtemplate.template = $scope.selectedtemplate.template.replace("{" , "{{" ) ;
$scope.selectedtemplate.template = $scope.selectedtemplate.template.replace("}" , "}}" ) ;
The variable template
holds the HTML string.