//Controller层中 获取到富文本框的值editor.html() 赋值给$scope.entity.goodsDesc.introduction
//增加商品
$scope.add=function(){
$scope.entity.goodsDesc.introduction=editor.html();
goodsService.add( $scope.entity ).success(
function(response){
if(response.success){
alert("新增成功");
$scope.entity={};
editor.html("");//清空富文本编辑器
}else{
alert(response.message);
alert("新增失败");
}
}
);
}
//页面输入框 name="content"与 'textarea[name="content"]'相关联
<div class="col-md-10 data editer">
<textarea name="content" style="width:800px;height:400px;visibility:hidden;" ></textarea>
</div>
// 页面中添加 在body中
<!-- 正文区域 /-->
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
allowFileManager : true
});
});
</script>