-
-
Save shotaK/8847d9f220a9eff71069 to your computer and use it in GitHub Desktop.
Custom filter to trust all html.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WARNING: Use with caution. Don't use when displaying user-created content. | |
app.filter('html', ['$sce', function ($sce) { | |
return function(t) { | |
return $sce.trustAsHtml(t) | |
} | |
}]); | |
// Usage | |
<span ng-bind-html="yourDataValue | html"></span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment