AngularJS教程十一—— 文字編輯器kindeditor

hy3112發表於2016-01-29

自定義表格指令ed-keditor

ed-keditor是對Kind Editer的封裝,以支援資料的雙向繫結,使其能夠像普通的textarea來使用

一 使用方法:

<textarea ed-keditor ng-model="content" cols="30" rows="10"></textarea>

預設設定屬性:

{
    resizeType: 1,
    //minWidth: '250px',
    allowPreviewEmoticons: false,
    allowImageUpload: false,
    items: [
        'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
        'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', '|', 'emoticons', 'image', 'link'],
    autoHeightMode: false,
    afterCreate: function () {
        this.loadPlugin('autoheight');
    }
}

如預設屬性不滿足,則可以通過設定ed-keditor的值為需要調整的屬性值即可。如:

<textarea ed-keditor="keConfig" ng-model="content" cols="30" rows="10"></textarea>

$scope.keConfig = {width :  '700px'};//  

相關文章