基于angular(v2+)的tinymce组件(Angular(v2+) tinymce component)
基于angular(v2+)的tinymce组件
tinymce
和 @twp0217/ngx-tinymce
npm install tinymce @twp0217/ngx-tinymce --save
angular-cli.json
中增加tinymce
配置
"scripts": [
"node_modules/tinymce/tinymce.js",
"node_modules/tinymce/themes/modern/theme.js"
]
NgxTinymceModule
import { NgxTinymceModule } from "@twp0217/ngx-tinymce";
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
NgxTinymceModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<ngx-tinymce [(ngModel)]="html"></ngx-tinymce>
在 map
中添加以下配置
map: {
'ngx-tinymce': 'npm:ngx-tinymce/bundles/ngx-tinymce.umd.min.js'
}
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
options | TinymceOptions | { skin_url = “assets/tinymce/skins/lightgray”; } | 配置项 |
onClick
onDblClick
onMouseDown
onMouseUp
onMouseMove
onMouseOver
onMouseOut
onMouseEnter
onMouseLeave
onKeyDown
onKeyPress
onKeyUp
onContextMenu
onPaste
onInit
onFocus
onBlur
onBeforeSetContent
onSetContent
onGetContent
onPreProcess
onPostProcess
onNodeChange
onUndo
onRedo
onChange
onDirty
onRemove
onExecCommand
onPastePreProcess
onPastePostProcess