mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +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
|
|
@ -34,12 +34,14 @@
|
||||||
"@angular/router": "4.0.3",
|
"@angular/router": "4.0.3",
|
||||||
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.25",
|
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.25",
|
||||||
"bootstrap": "4.0.0-alpha.6",
|
"bootstrap": "4.0.0-alpha.6",
|
||||||
|
"ckeditor": "4.6.2",
|
||||||
"classlist.js": "1.1.20150312",
|
"classlist.js": "1.1.20150312",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"immutable": "3.8.1",
|
"immutable": "3.8.1",
|
||||||
"intl": "1.2.5",
|
"intl": "1.2.5",
|
||||||
"ionicons": "2.0.1",
|
"ionicons": "2.0.1",
|
||||||
|
"ng2-ckeditor": "1.1.6",
|
||||||
"normalize.css": "6.0.0",
|
"normalize.css": "6.0.0",
|
||||||
"rxjs": "5.1.1",
|
"rxjs": "5.1.1",
|
||||||
"tether": "1.4.0",
|
"tether": "1.4.0",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { NgaCardModule } from '@nga/theme';
|
import { NgaCardModule } from '@nga/theme';
|
||||||
|
import { CKEditorModule } from 'ng2-ckeditor';
|
||||||
|
|
||||||
@NgModule ({
|
@NgModule ({
|
||||||
exports: [
|
exports: [
|
||||||
|
|
@ -11,6 +12,7 @@ import { NgaCardModule } from '@nga/theme';
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
NgaCardModule,
|
NgaCardModule,
|
||||||
|
CKEditorModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class NgxSharedModule { }
|
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 { NgxEditorsComponent } from './editors.component';
|
||||||
import { NgxTinyMCEComponent, NgxTinyMCEEditorComponent } from './tinyMCE.component';
|
import { NgxTinyMCEComponent, NgxTinyMCEEditorComponent } from './tinyMCE.component';
|
||||||
|
import { NgxCKEditorComponent } from './ckeditor.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
|
|
@ -13,6 +14,10 @@ const routes: Routes = [
|
||||||
path: 'tinymce',
|
path: 'tinymce',
|
||||||
component: NgxTinyMCEComponent,
|
component: NgxTinyMCEComponent,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'ckeditor',
|
||||||
|
component: NgxCKEditorComponent,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
@ -23,4 +28,9 @@ const routes: Routes = [
|
||||||
})
|
})
|
||||||
export class NgxEditorsRoutingModule { }
|
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',
|
title: 'TinyMCE',
|
||||||
link: '/pages/editors/tinymce',
|
link: '/pages/editors/tinymce',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'CKEditor',
|
||||||
|
link: '/pages/editors/ckeditor',
|
||||||
|
},
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
17
yarn.lock
17
yarn.lock
|
|
@ -834,6 +834,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
inherits "^2.0.1"
|
inherits "^2.0.1"
|
||||||
|
|
||||||
|
ckeditor@4.6.2:
|
||||||
|
version "4.6.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/ckeditor/-/ckeditor-4.6.2.tgz#b1552b7a2f9537e165d7afd2d29d3d4959ff6bad"
|
||||||
|
|
||||||
clap@^1.0.9:
|
clap@^1.0.9:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/clap/-/clap-1.1.3.tgz#b3bd36e93dd4cbfb395a3c26896352445265c05b"
|
resolved "https://registry.yarnpkg.com/clap/-/clap-1.1.3.tgz#b3bd36e93dd4cbfb395a3c26896352445265c05b"
|
||||||
|
|
@ -3453,6 +3457,10 @@ negotiator@0.6.1:
|
||||||
version "0.6.1"
|
version "0.6.1"
|
||||||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||||
|
|
||||||
|
ng2-ckeditor@1.1.6:
|
||||||
|
version "1.1.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/ng2-ckeditor/-/ng2-ckeditor-1.1.6.tgz#fa3afb86982b725f7f3a609924c64821c2719875"
|
||||||
|
|
||||||
no-case@^2.2.0:
|
no-case@^2.2.0:
|
||||||
version "2.3.1"
|
version "2.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.1.tgz#7aeba1c73a52184265554b7dc03baf720df80081"
|
resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.1.tgz#7aeba1c73a52184265554b7dc03baf720df80081"
|
||||||
|
|
@ -5922,20 +5930,13 @@ write-file-stdout@0.0.2:
|
||||||
version "0.0.2"
|
version "0.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/write-file-stdout/-/write-file-stdout-0.0.2.tgz#c252d7c7c5b1b402897630e3453c7bfe690d9ca1"
|
resolved "https://registry.yarnpkg.com/write-file-stdout/-/write-file-stdout-0.0.2.tgz#c252d7c7c5b1b402897630e3453c7bfe690d9ca1"
|
||||||
|
|
||||||
ws@1.1.1:
|
ws@1.1.1, ws@^1.0.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.1.tgz#082ddb6c641e85d4bb451f03d52f06eabdb1f018"
|
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.1.tgz#082ddb6c641e85d4bb451f03d52f06eabdb1f018"
|
||||||
dependencies:
|
dependencies:
|
||||||
options ">=0.0.5"
|
options ">=0.0.5"
|
||||||
ultron "1.0.x"
|
ultron "1.0.x"
|
||||||
|
|
||||||
ws@^1.0.1:
|
|
||||||
version "1.1.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61"
|
|
||||||
dependencies:
|
|
||||||
options ">=0.0.5"
|
|
||||||
ultron "1.0.x"
|
|
||||||
|
|
||||||
wtf-8@1.0.0:
|
wtf-8@1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"
|
resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue