Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Compatibility with Angular Universal #62

@suparnavg

Description

@suparnavg

@surmon-china
I'm following the official Angular instructions to set up server side rendering using Angular Universal.

However, during the compilation process, an error is thrown:

elem.classList.toggle('test-class', false);
TypeError: Cannot read property 'toggle' of undefined
    at Object.DIFF_DELETE (

This is coming from the underlying quill.js module, specifically this part in the dist/quill.js file:

var elem = document.createElement('div');
elem.classList.toggle('test-class', false);
if (elem.classList.contains('test-class')) {
  var _toggle = DOMTokenList.prototype.toggle;
  DOMTokenList.prototype.toggle = function (token, force) {
    if (arguments.length > 1 && !this.contains(token) === !force) {
      return force;
    } else {
      return _toggle.call(this, token);
    }
  };
}

The document object is not available on the server - would it be possible to design a workaround for this scenario (as this will be an invaluable addition to the library). Happy to help in any way.

Some ideas here: KillerCodeMonkey/ngx-quill#91, KillerCodeMonkey/ngx-quill#57

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