I am trying to use the editor control in primeng: https://www.primefaces.org/primeng/#/editor
But I am getting the error:
ERROR ReferenceError: Quill is not defined at Editor.webpackJsonp.../../../../primeng/components/editor/editor.js.Editor.ngAfterViewInit
My project uses:
I found this issue: https://github.com/primefaces/primeng/issues/807
I followed the instructions:
import {EditorModule} from 'primeng/primeng';
npm install quill --save
npm install @types/quill --save
"styles": [ "../node_modules/quill/dist/quill.core.css", "../node_modules/quill/dist/quill.snow.css", ], "scripts": [ "../node_modules/quill/dist/quill.js" ],
but it still has the same issue. I am just adding default markup:
<p-editor [(ngModel)]="text" [style]="{'height':'320px'}"></p-editor>
And I get the error and it looks like this:
The only thing on that thread I didn't try is installing the webpack plugin because I am using angular cli I don't think that is an option.
What can I try to fix this?
Try This: it's working for me perfectly
Versions:
Node : 7.9.0
angular/cli: 1.3.0
angular: 4.3.6
npm: 4.2.0
primeng": "^4.2.0-rc.1"
install node module quill
npm install quill --save
.angular-cli.json
"styles": [
"../node_modules/primeng/resources/themes/omega/theme.css",
"../node_modules/primeng/resources/primeng.min.css",
"../node_modules/quill/dist/quill.core.css",
"../node_modules/quill/dist/quill.snow.css"
],
"scripts": [
"../node_modules/quill/dist/quill.js"
]
app.module.ts
import { EditorModule } from 'primeng/primeng';
@NgModule({
imports: [
EditorModule
]
})
app.component.html
<p-editor [(ngModel)]="text" [style]="{'height':'320px'}"></p-editor>
app.component.ts
export class AppComponent {
text: string;
}