Giter VIP home page Giter VIP logo

Comments (6)

daslicht avatar daslicht commented on May 31, 2024

How about AngularJS 1.4.3 ?

from angular-froala.

julian-iFactory avatar julian-iFactory commented on May 31, 2024

How about AngularJS 1.4.4 ?

froala-sanitize causes console errors when used with newer version of AngularJS, [ 1.4.3 & 1.4.4 ]. Replacing froala-sanitize.js with latest angular-sanitize.js removes these errors.

The error appears when invoking ng-bind-html and Angular Strap Popovers with HTML templates. Google Chrome console error:

TypeError: html.indexOf is not a function    
at htmlParser (/angular-froala/src/froala-sanitize.js:254:17)    
at $get (/angular-froala/src/froala-sanitize.js:148:7)    
at getTrusted (/angular/angular.js:16764:16)    
at Object.$get.sce.(anonymous function) [as getTrustedHtml] (/angular/angular.js:17444:16)    
at Object.ngBindHtmlWatchAction [as fn] (/angular/angular.js:22374:29)    
at Scope.$get.Scope.$digest (/angular/angular.js:15753:29)    
at safeDigest (/angular-strap/dist/angular-strap.js:3952:70)    
at Object.angular.module.provider.$get.$tooltip.show (/angular-strap/dist/angular-strap.js:3604:11)    
at Object.angular.module.provider.$get.$tooltip.enter (/angular-strap/dist/angular-strap.js:3568:29)    
at HTMLButtonElement.angular.module.provider.$get.$tooltip.toggle (/angular-strap/dist/angular-strap.js:3673:59) undefined

** UPDATE **

The angular-froala & angularJS 1.4.x console error is being triggered when you pass an integer to ng-bind.

<span ng-bind="number"></span>

If you inspect ngSanitize 1.4.4 it has a conditional to ensure the data is of type string. Adding this to froala-sanitize.js fixes the problem:

function htmlParser( html, handler ) {

    // Added code from newer ngSanitize 1.4.3/1.4.4 version.
    // --- Start ---
    if (typeof html !== 'string') {
        if (html === null || typeof html === 'undefined') {
            html = '';
        } else {
            html = '' + html;
        }
    }
    // --- End ---

  var index, chars, match, stack = [], last = html;
  stack.last = function() { return stack[ stack.length - 1 ]; };

from angular-froala.

daslicht avatar daslicht commented on May 31, 2024

Thats why I exactly don't like Angular or other technologies with hard dependencies .
Just use Summernote which is free compared to Froala ...

from angular-froala.

cgallarno avatar cgallarno commented on May 31, 2024

I've removed the hard requirement on angular and implemented @julian-iFactory's fix for sanitize in the editorV.2 branch.

from angular-froala.

momadthenomad avatar momadthenomad commented on May 31, 2024

Has this been fixed in the latest froala v2.7.6 release?

from angular-froala.

momadthenomad avatar momadthenomad commented on May 31, 2024

@cgallarno we've also run into this issue and used @julian-iFactory's fix but we don't see the fix in the current release of froala v2.8.1. Am I missing something?

from angular-froala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.