I'm using the angular-ui-bootstrap accordion. And I'm in a ng-repeat.
In my accordion heading I'm trying to bind to a scope variable with html in it.
I'm trying to bind the html with data-ng-bind-html and the angular $sce service.
I've also injected ngSanitize in my app.js.
But I don't get the result I want. This is my accordion heading:
<accordion close-others="true">
<accordion-group class="row" data-ng-repeat="content in pageContent" data-ng-if="content.pageId === page.id">
<accordion-heading data-ng-bind-html="trustedHtml(content.columnTitle)" ></accordion-heading>
<!-- rest of content -->
</accordion-group>
</accordion>
In my controller I inject $sce and this is the $scope method:
$scope.trustedHtml = function (input) {
return $sce.trustAsHtml(input);
}
Can anyone help me with this?