angular - Angular Froala _this._$element.froalaEditor 不是函数
问题描述
我已经阅读了 SO 和 git 上的所有答案,以弄清楚为什么 froalaEditor 在我的项目中不起作用。
这是我的设置:
我已经通过使用安装了插件
npm install angular-froala-wysiwyg --save
然后在我的 .angular-cli.json 中:
"styles": [
"styles.scss",
"../node_modules/froala-editor/css/froala_editor.pkgd.min.css",
"../node_modules/froala-editor/css/froala_style.min.css"
],
"scripts": [
"../node_modules/froala-editor/js/froala_editor.pkgd.min.js"
],
然后在我的模块中:
import {FroalaEditorModule, FroalaViewModule} from 'angular-froala-wysiwyg';
@NgModule({
imports: [
HttpClientModule, CommonModule, RouterModule.forChild(routes), LayoutModule, FormsModule, ReactiveFormsModule, DropzoneModule,
FroalaEditorModule.forRoot(), FroalaViewModule.forRoot()
], exports: [
RouterModule,
], declarations: [
ContentMakerComponent,
VideoElementComponent,
TextElementComponent,
MultipleChoiceElementComponent,
SoundElementComponent,
DocumentElementComponent
],
providers: [
{
provide: DROPZONE_CONFIG,
useValue: DEFAULT_DROPZONE_CONFIG
}
]
})
然后在我的组件中:
<div [froalaEditor]>Hello, Froala!</div>
现在,每当我打开组件时,我都会得到:
ERROR TypeError: _this._$element.froalaEditor is not a function
at eval (editor.directive.js:167)
at ZoneDelegate.invoke (zone.js:388)
at Zone.run (zone.js:138)
at NgZone.runOutsideAngular (core.js:4708)
at FroalaEditorDirective.createEditor (editor.directive.js:166)
at FroalaEditorDirective.ngOnInit (editor.directive.js:244)
at checkAndUpdateDirectiveInline (core.js:12411)
at checkAndUpdateNodeInline (core.js:13935)
at checkAndUpdateNode (core.js:13878)
at debugCheckAndUpdateNode (core.js:14771)
任何人都可以帮忙吗?
解决方案
推荐阅读
- entity-framework-core - 如果表不存在,实体框架核心创建表?
- django - 如何在 Django manytomanyfield 中访问生成的表字段
- docker - 更新在 docker 容器上运行的 Jenkins
- angular - 有没有办法在摩纳哥编辑器中实现多个游标?
- x86 - 处理器如何从 SPI 闪存读取 BIOS?
- javascript - 如何让js等待fetch请求的结果和处理继续上?
- android - 为什么单击它的项目时,adnroidx recycler-view click 不起作用?
- angular - TestBed 上的提供者和声明有什么区别
- osmnx - OSMnx的道路容量
- python - 在 Python 中的数据框中的列中添加 1 小时