https://github.com/twp0217/ngx-tinymce
基于angular(v2+)的tinymce组件(Angular(v2+) tinymce component)
https://github.com/twp0217/ngx-tinymce
editor ng ng2 ngx ngx-tinymce text-editor tinymce
Last synced: about 1 year ago
JSON representation
基于angular(v2+)的tinymce组件(Angular(v2+) tinymce component)
- Host: GitHub
- URL: https://github.com/twp0217/ngx-tinymce
- Owner: twp0217
- License: mit
- Created: 2018-12-01T01:41:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-25T09:36:04.000Z (over 7 years ago)
- Last Synced: 2025-02-13T14:06:52.687Z (over 1 year ago)
- Topics: editor, ng, ng2, ngx, ngx-tinymce, text-editor, tinymce
- Language: TypeScript
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ngx-tinymce
## 简介
基于angular(v2+)的tinymce组件
## 使用
- 安装依赖包:`tinymce` 和 `@twp0217/ngx-tinymce`
```javascript
npm install tinymce @twp0217/ngx-tinymce --save
```
- 在`angular-cli.json`中增加`tinymce`配置
```javascript
"scripts": [
"node_modules/tinymce/tinymce.js",
"node_modules/tinymce/themes/modern/theme.js"
]
```
- 在module导入`NgxTinymceModule`
```javascript
import { NgxTinymceModule } from "@twp0217/ngx-tinymce";
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
NgxTinymceModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```
- 在模板页面使用
```html
```
### system.js 配置
在 `map` 中添加以下配置
```javascript
map: {
'ngx-tinymce': 'npm:ngx-tinymce/bundles/ngx-tinymce.umd.min.js'
}
```
# 文档
## 属性(Attributes)
名称 | 类型 | 默认值 | 说明
---|---|---|---
options | TinymceOptions | { skin_url = "assets/tinymce/skins/lightgray"; } | 配置项
## [事件(Events)](https://www.tiny.cloud/docs/advanced/events/)
### Native
```javascript
onClick
onDblClick
onMouseDown
onMouseUp
onMouseMove
onMouseOver
onMouseOut
onMouseEnter
onMouseLeave
onKeyDown
onKeyPress
onKeyUp
onContextMenu
onPaste
```
### Core
```javascript
onInit
onFocus
onBlur
onBeforeSetContent
onSetContent
onGetContent
onPreProcess
onPostProcess
onNodeChange
onUndo
onRedo
onChange
onDirty
onRemove
onExecCommand
```
### Paste Plugin
```javascript
onPastePreProcess
onPastePostProcess
```
# 支持
- 如果项目对你有帮助,请点颗星:star:,谢谢。
- 如果你对项目有想法、问题、BUG,欢迎讨论。