Ryan
Ryan

Reputation: 2660

Angular InterpolateProvider Not Working (Custom Delimiters)

I've tired numerous iterations of the $interpolateProvider example code and have had zero success creating custom delimiters for templating. The below is a simple example of this that does not work. Can anyone help identify the issue? Or is this a potential issue with Angular version? Much appreciated.

<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js"></script>

<script type="text/javascript">

var myApp = angular.module('myApp', [], function($interpolateProvider) 

{
    $interpolateProvider.startSymbol('[[');
    $interpolateProvider.endSymbol(']]');
});

function MyCtrl($scope) {
    $scope.name = 'Superhero';
}
</script>
</head>

<body>
<div ng-controller="MyCtrl">
    Hello, [[name]]
</div>
</body>
</html>

Upvotes: 2

Views: 1074

Answers (1)

Austin Greco
Austin Greco

Reputation: 33554

The config part looks fine, I think you might need to set the ng-app properly?

should be

<html ng-app="myApp">

Upvotes: 3

Related Questions