(function(){"use strict";!function(){var a;a=angular.module("ng.ueditor",[]),a.directive("ueditor",[function(){return{restrict:"C",require:"ngModel",scope:{config:"=",ready:"="},link:function(a,b,c,d){var e,f;f=!1,new(e=function(){function e(){this.bindRender(),this.initEditor()}return e.prototype.initEditor=function(){var e,g,h;return h=this,"undefined"==typeof UE?void console.error("Please import the local resources of ueditor!"):(e=a.config?a.config:{},g=c.id?c.id:"_editor"+Date.now(),b[0].id=g,this.editor=new UE.ui.Editor(e),this.editor.render(g),this.editor.ready(function(){h.editorReady=!0,h.editor.addListener("contentChange",function(){d.$setViewValue(h.editor.getContent()),f||a.$$phase||a.$apply(),f=!1}),h.modelContent&&h.modelContent.length>0&&h.setEditorContent(),"function"==typeof a.ready&&a.ready(h.editor),a.$on("$destroy",function(){!c.id&&UE.delEditor&&UE.delEditor(g)})}))},e.prototype.setEditorContent=function(a){null==a&&(a=this.modelContent),this.editor&&this.editorReady&&this.editor.setContent(a)},e.prototype.bindRender=function(){var a;a=this,d.$render=function(){a.modelContent=d.$isEmpty(d.$viewValue)?"":d.$viewValue,f=!0,a.setEditorContent()}},e}())}}}])}()}).call(this);