Angular2 ckeditor编辑配置

问题描述 投票:2回答:3

这就是CKEditor文档如何配置编辑器http://docs.ckeditor.com/#!/guide/dev_toolbarconcepts-section-toolbar-groups-configuration

我在html中使用这样的东西

<ckeditor
  [(ngModel)]="ckeditorContent"
  [config]="{toolbar : 'Basic', uiColor: '#FFFFFF'}"
  (change)="onChange($event)"
  (ready)="onReady($event)"
  (focus)="onFocus($event)"
  (blur)="onBlur($event)"
  debounce="1000"
  >
</ckeditor>

那么如何在angular2中将此配置提供给我的CKEditor?

angular configuration ckeditor
3个回答
5
投票

根据documentation你应该传递配置对象作为输入:

import { Component } from '@angular/core';

@Component({
  selector: 'sample',
  template: `
  <ckeditor
    [config]="config">
  </ckeditor>
  `
})
export class Sample{
  constructor(){
    this.config = {uiColor: '#99000'};
  }
}

0
投票

通过配置输入传递配置对象


0
投票

https://www.npmjs.com/package/ng2-ckeditor

通常,我们可以使用下面的配置值来删除角度和反应js的工具栏

this.ckeConfig = {
      allowedContent: false,
      forcePasteAsPlainText: true,
      removePlugins: 'horizontalrule,tabletools,specialchar,about,list,others',
      removeButtons: 'Save,NewPage,Preview,Print,Templates,Replace,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Find,Select,Button,ImageButton,HiddenField,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,CopyFormatting,CreateDiv,BidiLtr,BidiRtl,Language,Flash,Smiley,PageBreak,Iframe,Font,FontSize,TextColor,BGColor,ShowBlocks,Cut,Copy,Paste,Table,Image,Format,Source,Maximize,Styles,Anchor,SpecialChar,PasteFromWord,PasteText,Scayt,Undo,Redo,Strike,RemoveFormat,Indent,Outdent,Blockquote,Underline'
    };
© www.soinside.com 2019 - 2024. All rights reserved.