富文本编辑器,Rich Text Editor
官网地址:http://kindeditor.net/
使用方法
将下载得到的压缩包进行解压,之后将文件夹拖拽到你的项目中,然后引入文件下方(位置可能变动)
当中的方法可以在官网的模板界面,检查元素进行查找。
<link rel="stylesheet" href="../plugins/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="../plugins/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script>
初始化 kindeditor 编辑器
<textarea name="content" style="width:800px;height:400px;visibility:hidden;" >
编辑器所在的位置
</textarea>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
allowFileManager : true
});
});
</script>
提取 kindeditor 编辑器的内容
goodsController.js
//设置富文本编辑器的内容
$scope.setEditorValue=function(){
$scope.entity.goodsDesc.introduction=editor.html();