1 Star 0 Fork 1

ozinne / ngx-neditor

forked from Notadd / ngx-neditor 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 2.57 KB
一键复制 编辑 原始数据 按行查看 历史
天魂 提交于 2018-08-17 18:26 . chore(git): init repository

ngx-neditor

基于@notadd/neditor,更现代化的富文本编辑器angular组件

How to use

step-1

安装@notadd/ngx-neditor

  • npm install @notadd/ngx-neditor

安装依赖

  • mkdir -p ./src/assets/node_modules
  • npm install --prefix ./src/assets @notadd/neditor

⚠ neditor需在assets/node_modules下安装

step-2

  • 添加NgxNeditorModule到你的AppModule
  import { NgxNeditorModule } from '@notadd/ngx-neditor';

  @NgModule({
    imports: [
        ...
        NgxNeditorModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
  })
  export class AppModule { }

step-3

  • 在你的component中添加ngx-neditor组件
<ngx-neditor [(ngModel)]="content" #neditor [config]="config"></ngx-neditor>

属性

名称 类型 默认值 描述
config Object - 前端配置项说明,见官网
loadingTip string 加载中... 初始化提示文本
disabled boolean false 是否禁用
delay number 50 延迟初始化UEditor,单位:毫秒
neOnReady EventEmitter<UEditorComponent> - 编辑器准备就绪后会触发该事件,并会传递 NgxNeditorComponent 当前实例对象,可用于后续操作。
neOnDestroy EventEmitter - 编辑器组件销毁后会触发该事件
ngModelChange EventEmitter<string> - 编辑器内容发生改变时会触发该事件

This project was generated with Angular CLI version 6.0.1.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

JavaScript
1
https://gitee.com/ozinne/ngx-neditor.git
git@gitee.com:ozinne/ngx-neditor.git
ozinne
ngx-neditor
ngx-neditor
master

搜索帮助