프로젝트
GitHub에서 보기
yabab-dev/ng2-ckeditor
소개
Angular2 CKEditor component
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAngular - CKEditor component
Use the CKEditor (4.x) wysiwyg in your Angular application.
Installation
- Include CKEditor javascript files in your application :
<script src="https://cdn.ckeditor.com/4.19.1/full-all/ckeditor.js"></script>
Install ng2-ckeditor
- JSPM :
jspm install npm:ng2-ckeditor - NPM :
npm install ng2-ckeditor - YARN:
yarn add ng2-ckeditor
- JSPM :
Install @types/ckeditor
- JSPM :
jspm install npm:@types/ckeditor - NPM :
npm install --save @types/ckeditor - YARN :
yarn add @types/ckeditor
- JSPM :
SystemJS Config :
System.config({
map: {
'ng2-ckeditor': 'npm:ng2-ckeditor',
},
packages: {
'ng2-ckeditor': {
main: 'lib/index.js',
defaultExtension: 'js',
},
},
});
- Please consider usage of the plugin
divareaof CKEditor (see Issues)
Sample
Include CKEditorModule in your main module :
import { CKEditorModule } from 'ng2-ckeditor';
import { FormsModule } from '@angular/forms';
@NgModule({
// ...
imports: [CKEditorModule, FormsModule],
// ...
})
export class AppModule {}
Then use it in your component :
import { Component } from '@angular/core';
@Component({
selector: 'sample',
template: `
<ckeditor
[(ngModel)]="ckeditorContent"
[config]="{uiColor: '#99000'}"
[readonly]="false"
(change)="onChange($event)"
(editorChange)="onEditorChange($event)" <!-- CKEditor change event -->
(ready)="onReady($event)"
(focus)="onFocus($event)"
(blur)="onBlur($event)"
(contentDom)="onContentDom($event)"
(fileUploadRequest)="onFileUploadRequest($event)"
(fileUploadResponse)="onFileUploadResponse($event)"
(paste)="onPaste($event)"
(drop)="onDrop($event)"
debounce="500">
</ckeditor>
`,
})
export class Sample {
ckeditorContent: string = '<p>Some html</p>';
}
Configuration
config: The configuration object for CKEditor see http://docs.ckeditor.com/#!/api/CKEDITOR.configdebounce: You can add a delay (ms) when updating ngModelreadonly: Enabled / disable readonly on editor
Toolbar Directives
You can use the following directives to add custom buttons to CKEditor's toolbar and organize them into groups. For more info about CKEditor's Toolbar API refer to http://docs.ckeditor.com/#!/api/CKEDITOR.ui
<ckbutton>: Note that thenameandcommandattributes are mandatory for this one.
<ckeditor
[(ngModel)]="ckeditorContent">
<ckbutton [name]="'saveButton'"
[command]="'saveCmd'"
(click)="save($event)"
[icon]="'save.png'"
[label]="'Save Document'"
[toolbar]="'clipboard,1'">
</ckbutton>
</ckeditor>
<ckgroup>: Can be used to organize multiple buttons into groups.
<ckeditor
[(ngModel)]="ckeditorContent">
<ckgroup
[name]="'documenthandling'"
[previous]="'1'">
<ckbutton .... ></ckbutton>
<ckbutton .... ></ckbutton>
</ckgroup>
</ckeditor>
Issues
Licence
See LICENSE file
관련 프로젝트 살펴보기
불러오는 중…