mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-03-13 08:56:14 +01:00
style(lint): improve lint issues
This commit is contained in:
parent
3ac268a096
commit
f04763cecd
16 changed files with 19 additions and 78 deletions
|
|
@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
|
|||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EditorsComponent } from './editors.component';
|
||||
import { TinyMCEComponent, TinyMCEEditorComponent } from './tinyMCE.component';
|
||||
import { TinyMCEComponent } from './tiny-mce/tiny-mce.component';
|
||||
import { CKEditorComponent } from './ckeditor.component';
|
||||
|
||||
const routes: Routes = [{
|
||||
|
|
@ -26,6 +26,5 @@ export class EditorsRoutingModule { }
|
|||
export const routedComponents = [
|
||||
EditorsComponent,
|
||||
TinyMCEComponent,
|
||||
TinyMCEEditorComponent,
|
||||
CKEditorComponent,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {Component} from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-tiny-mce-page',
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
import { Component, OnDestroy, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-tinymce-editor',
|
||||
template: `
|
||||
<textarea id="{{ elementId }}"></textarea>
|
||||
`,
|
||||
})
|
||||
export class TinyMCEEditorComponent implements OnDestroy, AfterViewInit {
|
||||
|
||||
@Input() elementId: string;
|
||||
|
||||
@Output() editorKeyup = new EventEmitter<any>();
|
||||
|
||||
editor: any;
|
||||
|
||||
ngAfterViewInit() {
|
||||
tinymce.init({
|
||||
selector: '#' + this.elementId,
|
||||
plugins: ['link', 'paste', 'table'],
|
||||
skin_url: 'assets/skins/lightgray',
|
||||
setup: editor => {
|
||||
this.editor = editor;
|
||||
|
||||
editor.on('keyup', () => {
|
||||
const content = editor.getContent();
|
||||
|
||||
this.editorKeyup.emit(content);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
tinymce.remove(this.editor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-tinymce',
|
||||
template: `
|
||||
<nga-card>
|
||||
<nga-card-body>
|
||||
<ngx-tinymce-editor elementId="tinymceEditor" (editorKeyup)="editorKeyupHandler($event)"></ngx-tinymce-editor>
|
||||
</nga-card-body>
|
||||
</nga-card>
|
||||
`,
|
||||
})
|
||||
export class TinyMCEComponent {
|
||||
|
||||
editorKeyupHandler($event) {
|
||||
console.info($event);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue