ngx-summernote: ERROR TypeError: _this._$element.summernote is not a function
I have error ERROR TypeError: _this._$element.summernote is not a function
in
Installation Install ngx-summernote and dependencies:
npm install --save summernote ngx-summernote
Editor Add add JQuery and Summernote scripts and styles in angular.json file:
"styles": [
...
"node_modules/summernote/dist/summernote-lite.css"
],
"scripts": [
...
"node_modules/jquery/dist/jquery.min.js",
"node_modules/summernote/dist/summernote-lite.js"
]
Use [ngxSummernote] directive on an element to init Summernote editor:
<div [ngxSummernote]></div>
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (8 by maintainers)
The issue still persist in stackblitz (ignoring angular.json) but at least the demo project works in stackblitz now 🎉
https://stackblitz.com/edit/angular-summernote-demo-zwzcyj
Version 0.7.6 is released with some of the changes done to make the demo work in stackblitz. Changes are related to summernote element initialization, now done only when jquery is loaded.
🙏 Many thanks to @dev-sharan for stackblitz workaround and @stephanrauh for spending his time to point me to the timing problem. You guys rock 🙌 !