I'm getting a html with angular content from a service, the content is something like that
<div>{{ @event.dateBegin | stringToDate }}</div>
the service is something 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 for result I got the correct html formmed div, but the part {{ }} dosen't work,I agree angular-sanitize but dosen't work too
You can use the $interpolate service. Example in the docs:
var $interpolate = ...; // injected
var exp = $interpolate('Hello {{name}}!');
expect(exp({name:'Angular'}).toEqual('Hello Angular!');
So, in your specific example, inside your success callback:
var exp = $interpolate(response);
$scope.content = exp(event);
As a recommendation, I would just pass back the data, not the HTML, if you can help it and keep all of the templates in your angular application.