angular - CKEDITOR:如何使用 CKEDITOR4 在 typescript 中获取编辑器的实例
问题描述
如何处理 Typescript 中的 CKEDITOR 4 插件(应用程序是 Angular 9)?
我需要通过打字稿(自动增长)设置配置并尝试执行 INSERT HTML 函数。
我已经导入了模块(见下文)......但在属性中并不多。
从'ckeditor4-angular/ckeditor'导入{CKEditor4};
解决方案
做这样的事情:
在html中添加#editor
<ckeditor #editor formControlName="resumen" data="<p>Hello, world!</p>"></ckeditor>
在组件中添加这个
@ViewChild('editor') editor;
现在您可以通过以下方式访问:
console.log(this.editor);
推荐阅读
- java - Java Hyperledger-panic:runtimr 错误:无效的内存地址或 nil 指针取消引用
- django - 基于 django 类的视图是否继承 method_decorators?
- oracle - 我不知道我的 SQL 有什么问题(在 Oracle SQL Developer 中)
- python - 无法使用 Scrapy 抓取下一页内容
- c# - WinForms NumericUpDown 不断乘以 10。为什么?
- php - 适用于 Web 应用程序的 Azure MySQL In App 不更新行
- javascript - 没有标签的html文本
- javascript - 复制对象数组
- events - 如何在微服务架构中共享事件代码
- ios - 应用程序终止时的 Firebase 推送通知和 IOS APNs 通知