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

Compatibility with Angular Universal #62

Open
suparnavg opened this issue Jul 29, 2018 · 1 comment
Open

Compatibility with Angular Universal #62

suparnavg opened this issue Jul 29, 2018 · 1 comment

Comments

@suparnavg
Copy link

@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

@KamilBanaszkiewicz
Copy link

i stick to this request too.

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

No branches or pull requests

2 participants