Anujarya300 / ng2-ckeditor

Angular2 CKEditor component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular2 - CKEditor component

Use the CKEditor (4.x) wysiwyg in your Angular2 application.

Installation

  • Include CKEditor javascript files in your application
  • Install ng2-ckeditor
    • JSPM : jspm install ng2-ckeditor=github:chymz/ng2-ckeditor
    • NPM : npm install ng2-ckeditor

Sample (ES6)

import {Component} from '@angular/core';
import {CKEditor} from 'ng2-ckeditor';

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

Other samples :

Configuration

  • config : The configuration object for CKEditor see http://docs.ckeditor.com/#!/api/CKEDITOR.config

  • [Deprecated : use file loader with your bundler] configFile : You can use a javacsript file to configure your CKEditor (Only work with SystemJS)

export var config = {
    uiColor: '#990000'
}

About

Angular2 CKEditor component

License:MIT License


Languages

Language:JavaScript 100.0%