Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div ng-bind-html-unsafe="group.description"></div>
- .directive('ngBindHtmlUnsafe', ['$sce', function($sce){
- return {
- scope: {
- ngBindHtmlUnsafe: '=',
- },
- template: "<div ng-bind-html='trustedHtml'></div>",
- link: function($scope, iElm, iAttrs, controller) {
- $scope.updateView = function() {
- $scope.trustedHtml = $sce.trustAsHtml($scope.ngBindHtmlUnsafe);
- }
- $scope.$watch('ngBindHtmlUnsafe', function(newVal, oldVal) {
- $scope.updateView(newVal);
- });
- }
- };
- }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement