mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-10 10:24:20 +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
|
|
@ -1,7 +1,7 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'footer',
|
||||
selector: 'ngx-footer',
|
||||
styleUrls: ['./footer.component.scss'],
|
||||
template: `
|
||||
<span class="created-by">Created with ♥ by <b><a href="https://akveo.com" target="_blank">Akveo</a></b> 2017</span>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { NgaSidebarService, NgaMenuService } from '@nga/theme';
|
|||
import { NgaThemeService } from '@nga/theme/services/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'header',
|
||||
selector: 'ngx-header',
|
||||
styleUrls: ['./header.component.scss'],
|
||||
template: `
|
||||
<div class="left">
|
||||
|
|
@ -14,7 +14,7 @@ import { NgaThemeService } from '@nga/theme/services/theme.service';
|
|||
</div>
|
||||
|
||||
<nga-actions size="medium" inverse class="right">
|
||||
<nga-action><search-input></search-input></nga-action>
|
||||
<nga-action><ngx-search-input></ngx-search-input></nga-action>
|
||||
<nga-action icon="ion-ios-email-outline"></nga-action>
|
||||
<nga-action disabled icon="ion-ios-bell-outline"></nga-action>
|
||||
<nga-action>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
export * from './header/header.component';
|
||||
export * from './footer/footer.component';
|
||||
export * from '../components/search-input/search-input.component';
|
||||
export * from './search-input/search-input.component';
|
||||
export * from './tiny-mce/time-mce.component';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Component, ElementRef, EventEmitter, Output, ViewChild } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'search-input',
|
||||
selector: 'ngx-search-input',
|
||||
styleUrls: ['./search-input.component.scss'],
|
||||
template: `
|
||||
<i class="control-icon ion ion-ios-search"
|
||||
|
|
|
|||
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