angular-summernote icon indicating copy to clipboard operation
angular-summernote copied to clipboard

Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context.

Open qmainuddin opened this issue 5 years ago • 0 comments

I am trying to add summernote to my project. I followed the instruction given in the documentation. But unfortunately getting the following error in the browser -

Error stacktrace: Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context. http://errors.angularjs.org/1.3.15/$sce/unsafe at angular.js:63 at htmlSanitizer (angular.js:15142) at getTrusted (angular.js:15306) at Object.sce. [as getTrustedHtml] (angular.js:15986) at Object.ngBindHtmlWatchAction [as fn] (angular.js:20593) at Scope.$digest (angular.js:14308) at Scope.$apply (angular.js:14571) at bootstrapApply (angular.js:1455) at Object.invoke (angular.js:4203) at doBootstrap (angular.js:1453)

Angularjs version: 1.3.15 jquery version: 1.11.1 summernote version: 0.8.15 angular-summernote version: 0.8.1

editor-controller.js:

app.controller("EditorController", ['$scope',
  function($scope) {
    console.log('Edit Controller');
      $scope.html = "";
      $scope.options = {
          height: 250,
          toolbar: [
              ['style', ['bold', 'italic', 'underline', 'clear', 'formatH1']],
              ['color', ['color']],
              ['para', ['ul', 'ol', 'paragraph']],
              ['height', ['height']]
          ]
      };
  }
]);

ap.js:

var app = angular
    .module('myApp', [
//        'angular-loading-bar',   !! Removed for now, as this creates greater perceived slowness. !!
//         'textAngular',
        'summernote',
    ]);

page.html: <summernote ng-model="description" placeholder="Description"></summernote>

N.B: I previously used textAngular. Since the community of textAngular are no longer active, I decided to switch to summernote. But this problem makes me disappointed. They were using textAngular-sanitize.min.js to relsolve this kind of problem. Is there something we needed to add for summernote?

qmainuddin avatar Jan 13 '20 13:01 qmainuddin