mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-16 14:35:29 +01:00
feat(editors): add a ckeditor component page
This commit is contained in:
parent
ef0acbc72b
commit
0fc2b32085
7 changed files with 60 additions and 10 deletions
|
|
@ -3,14 +3,16 @@ import { CommonModule } from '@angular/common';
|
|||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgaCardModule } from '@nga/theme';
|
||||
import { CKEditorModule } from 'ng2-ckeditor';
|
||||
|
||||
@NgModule({
|
||||
@NgModule ({
|
||||
exports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
RouterModule,
|
||||
NgaCardModule,
|
||||
CKEditorModule,
|
||||
],
|
||||
})
|
||||
export class NgxSharedModule { }
|
||||
|
|
|
|||
30
src/app/pages/editors/ckeditor.component.ts
Normal file
30
src/app/pages/editors/ckeditor.component.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
OnDestroy,
|
||||
AfterViewInit,
|
||||
Input,
|
||||
Output,
|
||||
EventEmitter,
|
||||
} from '@angular/core';
|
||||
|
||||
import './ckeditor.loader';
|
||||
import 'ckeditor';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-ckeditor',
|
||||
template: `
|
||||
<nga-card>
|
||||
<nga-card-body>
|
||||
<ckeditor [config]="{extraPlugins: 'divarea'}"></ckeditor>
|
||||
</nga-card-body>
|
||||
</nga-card>
|
||||
`,
|
||||
})
|
||||
export class NgxCKEditorComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() { }
|
||||
|
||||
}
|
||||
1
src/app/pages/editors/ckeditor.loader.ts
Normal file
1
src/app/pages/editors/ckeditor.loader.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
window['CKEDITOR_BASEPATH'] = '//cdn.ckeditor.com/4.6.2/full-all/';
|
||||
|
|
@ -3,6 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
|
|||
|
||||
import { NgxEditorsComponent } from './editors.component';
|
||||
import { NgxTinyMCEComponent, NgxTinyMCEEditorComponent } from './tinyMCE.component';
|
||||
import { NgxCKEditorComponent } from './ckeditor.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
|
|
@ -13,6 +14,10 @@ const routes: Routes = [
|
|||
path: 'tinymce',
|
||||
component: NgxTinyMCEComponent,
|
||||
},
|
||||
{
|
||||
path: 'ckeditor',
|
||||
component: NgxCKEditorComponent,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
@ -23,4 +28,9 @@ const routes: Routes = [
|
|||
})
|
||||
export class NgxEditorsRoutingModule { }
|
||||
|
||||
export const routedComponents = [NgxEditorsComponent, NgxTinyMCEComponent, NgxTinyMCEEditorComponent];
|
||||
export const routedComponents = [
|
||||
NgxEditorsComponent,
|
||||
NgxTinyMCEComponent,
|
||||
NgxTinyMCEEditorComponent,
|
||||
NgxCKEditorComponent,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ export const menuItems: List<NgaMenuItem> = List([
|
|||
title: 'TinyMCE',
|
||||
link: '/pages/editors/tinymce',
|
||||
},
|
||||
{
|
||||
title: 'CKEditor',
|
||||
link: '/pages/editors/ckeditor',
|
||||
},
|
||||
]),
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue