Code Monkey home page Code Monkey logo

Comments (3)

rodneyjoyce avatar rodneyjoyce commented on August 16, 2024

I am getting something similar. Just evaluating different HTML Editors and followed the set up instructions. The editor appears but I get this error:

angular.js:13920 TypeError: Cannot read property 'trim' of undefined
at Quill.setHTML (http://localhost:62674/node_modules/quill/dist/quill.js:10527:14)
at g (http://localhost:62674/node_modules/ng-quill/src/ng-quill.min.js:1:2254)
at http://localhost:62674/node_modules/ng-quill/src/ng-quill.min.js:1:4094
at Scope.$emit (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17932:33)
at . (http://localhost:62674/node_modules/ng-quill/src/ng-quill.min.js:1:4579)

from ng-quill.

Cordobo avatar Cordobo commented on August 16, 2024

@mcblum It looks as the directive does not provide a default for the editors ngModel, the value is undefined and you get the type error (same here).

To solve this, I added an empty string as the initial value and the type error was gone.
If your your ngModel is ng-model="message", set:

$scope.message = '';

If you get an async value from a service, you can use $timeout to replace the empty string:

$timeout(function () {
$scope.message = 'Async Test content';
console.log($scope.message);
}, 3000);

from ng-quill.

Cordobo avatar Cordobo commented on August 16, 2024

I fixed this issue in the development branch. Hope @KillerCodeMonkey has time to merge this into master.

from ng-quill.

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.