Skip to content

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

Description

@qmainuddin

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions