Skip to content

Instantly share code, notes, and snippets.

@exit99
Last active August 29, 2015 14:10
Show Gist options
  • Save exit99/06ebf756c08a9e815501 to your computer and use it in GitHub Desktop.
Save exit99/06ebf756c08a9e815501 to your computer and use it in GitHub Desktop.
qaApp.filter('safe', function ($sce) {
return function (value) {
return $sce.trustAsHtml(value);
};
});
qaApp.filter('nl2br', function() {
return function(data) {
if (!data) return data;
return data.replace(/\n\r?/g, '<br />');
};
});
ng-bind-html="scope_variable | nl2br | safe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment