angular – PrimeNg错误:未定义Quill
我想在primeng:
https://www.primefaces.org/primeng/#/editor中使用编辑器控件
但是我收到了错误:
我的项目使用: > Angular Cli:1.4.1 我发现了这个问题:https://github.com/primefaces/primeng/issues/807 我按照说明操作: 导入编辑器模块 import {EditorModule} from 'primeng/primeng'; 安装包: npm install quill --save npm install @types/quill --save 更新angular-cli.json "styles": [ "../node_modules/quill/dist/quill.core.css","../node_modules/quill/dist/quill.snow.css",],"scripts": [ "../node_modules/quill/dist/quill.js" ], 但它仍然有同样的问题.我只是添加默认标记: <p-editor [(ngModel)]="text" [style]="{'height':'320px'}"></p-editor> 我得到错误,它看起来像这样: 我没有尝试的那个线程上唯一的东西是安装webpack插件,因为我使用的是角度cli,我不认为这是一个选项. 我可以尝试解决这个问题? 解决方法
试试这个:它对我来说很完美
版本: Node : 7.9.0 angular/cli: 1.3.0 angular: 4.3.6 npm: 4.2.0 primeng": "^4.2.0-rc.1" 安装节点模块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; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |