【发布时间】:2018-02-14 03:53:06
【问题描述】:
我正在尝试在我的项目中使用 angular2-tinymce 库。我已成功将 tinymce 集成到我的模块中。但我找不到任何方法可以从 tinymce 编辑器中光标所在的位置插入文本。
// in add-progress-note.module.ts file
@NgModule({
declarations: [
AddProgressNotePage,
],
imports: [
IonicPageModule.forChild(AddProgressNotePage),
TinymceModule.withConfig({
menubar: false,
plugins: ['textcolor'],
toolbar: 'forecolor',
resize: false,
statusbar: false
})
]
})
// in add-progress-note.html file
<ion-row class="note-editor" id="noteArea">
<app-tinymce class="note-input-textarea" [(ngModel)]='noteText' (ngModelChange)="onChangeNote()"></app-tinymce>
</ion-row>
// in add-progress-note.ts file
onChangeNote(): void {
console.log(this.noteText);
}
我看到了这些链接:link1 和 link2。但我无法在 TinymceModule
的 setup 配置中编写回调如何在我的代码中合并在tinymce编辑器中从光标插入的文本?
【问题讨论】:
-
您是否尝试通过工具栏按钮执行此操作?一份菜单?还有什么?什么会触发这种插入?
-
我的页面中有一个按钮,就在 tinymce 编辑器的下方。当我单击按钮时,我将生成一个文本,我想将此文本附加到光标所在的 tinymce 编辑器中。
标签: angular ionic-framework tinymce