I want to replace the character { and } in a html string to {{ and }} i am using the replace function but i have the following error :
$scope.selectedtemplate.template.replace is not a function
My code
$scope.selectedtemplate.template = $scope.selectedtemplate.template.replace("{" , "{{" ) ;
$scope.selectedtemplate.template = $scope.selectedtemplate.template.replace("}" , "}}" ) ;
template is the HTML string
.replacemethod. Make sure the property really contains the value you expect at that time.nullcheck first and then do.replacestring.