KillerCodeMonkey/ng-quill

Incompatible with Angular ui router module

5Mixer opened this issue · 4 comments

Firstly, thank you for creating this library.

Placing a ng-quill-editor causes an error in my application only when the element is placed within a template for ui router. I believe this is due to controller conflicts between the ui.router state and the internals of this library, though I'm not knowledgeable enough of this library to be sure.

This is the full error (afraid I haven't been able to get it cleaner than this. Not using minified libraries.)

TypeError: linkNode is undefined
Stack trace:
nodeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:10002:11
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9248:13
nodeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:10002:11
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9248:13
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9251:13
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9251:13
publicLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9113:30
compile/<@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:9876:17
bind/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:1383:15
invokeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:10619:9
nodeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:10008:11
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9248:13
publicLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9113:30
lazyCompilation@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:9504:16
updateView@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:9784:38
configUpdatedCallback@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:9728:25
configureUIView@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:5728:17
ViewService.prototype.sync@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:5736:9
activateViews@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:6354:5
invokeCallback@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:1650:20
TransitionHook.prototype.invokeHook@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:1662:26
TransitionHook.runAllHooks/<@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:1634:48
TransitionHook.runAllHooks@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:1634:9
transitionSuccess@http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:3471:13
processQueue@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:17169:37
scheduleProcessQueue/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:17217:27
$digest@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:18352:15
$apply@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:18649:13
done@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:12627:36
completeRequest@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:12871:7
requestLoaded@https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js:12788:9
 <div ui-view="content" class="ng-scope">

I've tried stipulating the controller of the ng-quill-editor and surrounding it with a parent with my specified controller to no avail. I'd appreciate any help, thanks!

Edit:
Using angular v1.69, latest ui.router, ui.tree v2.22.6, interact.js v1.33, quill.js v1.3.6, ng-quill v3.6.0

i can not image how this component could produce such an error Oo.

can you provide a plunkr or codepen to demonstrate what you are doing?

Hmm. Well, I made a codepen, but (unfortunately for me and my project heh) it seems to work fine when it's isolated like this. https://codepen.io/anon/pen/MVxmKM. So obviously, I've thought the problem was a conflict with ui router but it's something else, which has left me pretty clueless. In my project it only works when it's not in a template file for the ui router, but rather just in my index.html file. I'm not really sure what I'll do now, but at least I've eliminated that possibility.

I'll get back to you if I have any more information, thanks. Edit: Also might be worth mentioning that quill works fine by itself as an element dropped into my ui router template. I'd use that by itself, but I'd like to use an angular directive, just because I need to support multiple quill's at once, and doing it with an angular directive is the best solution for that.

Hey, I got it, horray :)

Here was my problem: I had a quill element (not an angular quill element, just a div that I selected quill to use in js) next to my angular quill element (ng-quill-editor) and they seemed to be conflicting (or rather my quill js code that selected and used the div). Removing the other quill div and related javascript entirely fixed the issue. Awesome!

Sorry for any wasted time, a silly mistake!