Skip to content

Instantly share code, notes, and snippets.

@kmaida
Last active July 13, 2018 20:05
Show Gist options
  • Save kmaida/10f218a0ca94edbd1d0a to your computer and use it in GitHub Desktop.
Save kmaida/10f218a0ca94edbd1d0a to your computer and use it in GitHub Desktop.
AngularJS 1.2+ - $sce.trustAsHtml() using a filter. Usage: ng-bind-html="string | trustAsHTML"
myApp.filter('trustAsHTML', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment