想插入一个编辑器在页面上么?如上图所示,还可以转html哦~是不是很酷?在自己的页面上加上这么一个编辑器,瞬间变身高大上有木有? 只需简单的几步,满足你的需求!!
第一步,导入:
<script src="ngUeditor.js"></script>
第二步,引入Js文件
app.directive('ngUeditor', function () {
return {
restrict: 'AE',
transclude: true,
replace: true,
template: '<script name="content" type="text/plain" ng-transclude @style></script>',
require: '?ngModel',
scope: {
config: '=',
style:'@'
},
link: function (scope, element, attrs, ngModel) {
var editor = new UE.ui.Editor(scope.config || {});
var _editorId = attrs.id ? attrs.id : "_editor" + (Date.now());
element[0].id = _editorId;
editor.render(element[