2016-12-15 104 views
2

这是CKEditor的文档怎么说的来配置HTML编辑器http://docs.ckeditor.com/#!/guide/dev_toolbarconcepts-section-toolbar-groups-configurationAngular2的CKEditor编辑配置

我使用这样

<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的? ?

+1

https://github.com/chymz/ng2-ckeditor。你应该通过配置对象在配置输入 – Bazinga

+0

好吧,如果我通过config配置输入配置它的作品谢谢你 – kohli

+0

这是我的答案,这是不公平的:) – Bazinga

回答

3

传递配置对象按照documentation你应该通过配置对象作为输入:

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

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

通过配置输入