playframework 2.1 - angularjs filter remote content -


i'm getting html angular content service, content that

<div>{{ @event.datebegin | stringtodate }}</div> 

the service like

$scope.setcontext = function() {    $http.get(service).success(function(response) {           $scope.content = response;     });                    

the content div is

<div class="span9" ng-bind-html-unsafe="content"></div> 

and result got correct html formmed div, part {{ }} dosen't work,i agree angular-sanitize dosen't work too

you can use $interpolate service. example in docs:

var $interpolate = ...; // injected var exp = $interpolate('hello {{name}}!'); expect(exp({name:'angular'}).toequal('hello angular!'); 

so, in specific example, inside success callback:

var exp = $interpolate(response); $scope.content = exp(event); 

as recommendation, pass data, not html, if can , keep of templates in angular application.


Comments