Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qmainuddin opened this issue Jan 13, 2020 · 0 comments

Comments

@qmainuddin
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant