mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-24 10:16:10 +01:00
refactor(app): rename components, move tinymce to separate file
This commit is contained in:
parent
923e56c3d2
commit
3ac268a096
40 changed files with 199 additions and 136 deletions
33
src/app/@theme/components/tiny-mce/time-mce.component.ts
Normal file
33
src/app/@theme/components/tiny-mce/time-mce.component.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import {Component, OnDestroy, AfterViewInit, Output, EventEmitter, ElementRef} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-tiny-mce',
|
||||
template: '',
|
||||
})
|
||||
export class TinyMCEComponent implements OnDestroy, AfterViewInit {
|
||||
|
||||
@Output() editorKeyup = new EventEmitter<any>();
|
||||
|
||||
editor: any;
|
||||
|
||||
constructor(private host: ElementRef) { }
|
||||
|
||||
ngAfterViewInit() {
|
||||
tinymce.init({
|
||||
target: this.host.nativeElement,
|
||||
plugins: ['link', 'paste', 'table'],
|
||||
skin_url: 'assets/skins/lightgray',
|
||||
setup: editor => {
|
||||
this.editor = editor;
|
||||
editor.on('keyup', () => {
|
||||
let content = editor.getContent();
|
||||
this.editorKeyup.emit(content);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
tinymce.remove(this.editor);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue