在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ng2-ueditor开源软件地址:https://gitee.com/twp0217/ng2-ueditor开源软件介绍:ng2-ueditor简介Angular2 UEditor组件(Angular2 UEditor component) 安装npm install ng2-ueditor --save 使用
<script type="text/javascript" src="assets/ueditor/ueditor.config.js"></script><script type="text/javascript" src="assets/ueditor/ueditor.all.js"></script>
npm install ng2-ueditor --save
import { Ng2UeditorModule } from 'ng2-ueditor';@NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, HttpModule, Ng2UeditorModule ], providers: [], bootstrap: [AppComponent]})
<ng2-ueditor [(ngModel)]="content"></ng2-ueditor> 属性(Attributes)
事件(Events)
方法(Methods)
使用import { Ng2Ueditor } from 'ng2-ueditor';@ViewChild('ueditor') ueditor: Ng2Ueditor;console.log('编辑器内容:'+this.ueditor.getContent());console.log('纯文本内容,保留段落格式:'+this.ueditor.getPlainTxt());console.log('纯文本内容,没有段落格式:'+this.ueditor.getContentTxt());console.log('是否有内容:'+this.ueditor.hasContents()); 示例(基于angular-cli创建)
cd demo
npm install
ng serve |
请发表评论