Skip to content

Commit

Permalink
chore(git): init repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Tian-Hun committed Aug 17, 2018
1 parent 347cdd2 commit 2541970
Show file tree
Hide file tree
Showing 25 changed files with 1,724 additions and 80 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# dependencies
/node_modules

/src/assets/node_modules
/src/assets/package-lock.json

# IDEs and editors
/.idea
.project
Expand Down
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,59 @@
# NgxNeditor
# ngx-neditor

基于[@notadd/neditor](https://github.com/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

```typescript
import { NgxNeditorModule } from '@notadd/ngx-neditor';

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

#### step-3

+ 在你的component中添加`ngx-neditor`组件

```html
<ngx-neditor [(ngModel)]="content" #neditor [config]="config"></ngx-neditor>
```

## 属性

| 名称 | 类型 | 默认值 | 描述 |
| ------- | ------------- | ----- | ----- |
| config | `Object` | - | 前端配置项说明,[见官网](http://fex.baidu.com/ueditor/#start-config) |
| 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](https://github.com/angular/angular-cli) version 6.0.1.
---

## Development server

Expand Down
46 changes: 44 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"styles": [
"src/styles.css"
],
"scripts": []
"scripts": [
"node_modules/browser-md5-file/dist/browser-md5-file.js"
]
},
"configurations": {
"production": {
Expand Down Expand Up @@ -116,7 +118,47 @@
}
}
}
},
"@notadd/ngx-neditor": {
"root": "projects/notadd/ngx-neditor",
"sourceRoot": "projects/notadd/ngx-neditor/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/notadd/ngx-neditor/tsconfig.lib.json",
"project": "projects/notadd/ngx-neditor/ng-package.json"
},
"configurations": {
"production": {
"project": "projects/notadd/ngx-neditor/ng-package.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/notadd/ngx-neditor/src/test.ts",
"tsConfig": "projects/notadd/ngx-neditor/tsconfig.spec.json",
"karmaConfig": "projects/notadd/ngx-neditor/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/notadd/ngx-neditor/tsconfig.lib.json",
"projects/notadd/ngx-neditor/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ngx-neditor"
}
}
Loading

0 comments on commit 2541970

Please sign in to comment.