mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
Merge pull request #47 from Tibing/dev-editors
feat(app\pages): add editor page and ckeditor
This commit is contained in:
commit
d27221c32a
10 changed files with 75 additions and 1 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
"tests"
|
"tests"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Ionicons": "ionicons#~2.0.1"
|
"Ionicons": "ionicons#~2.0.1",
|
||||||
|
"ckeditor": "^4.5.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
"leaflet-map": "^0.2.1",
|
"leaflet-map": "^0.2.1",
|
||||||
"lodash": "^4.12.0",
|
"lodash": "^4.12.0",
|
||||||
"ng2-bootstrap": "^1.0.16",
|
"ng2-bootstrap": "^1.0.16",
|
||||||
|
"ng2-ckeditor": "^1.0.3",
|
||||||
"normalize.css": "^4.1.1",
|
"normalize.css": "^4.1.1",
|
||||||
"rxjs": "5.0.0-beta.6",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"tether": "^1.2.4",
|
"tether": "^1.2.4",
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,18 @@ export const menuItems = [
|
||||||
expanded: false,
|
expanded: false,
|
||||||
order: 0
|
order: 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Editors',
|
||||||
|
component: 'Editors',
|
||||||
|
icon: 'ion-edit',
|
||||||
|
order: 100,
|
||||||
|
subMenu: [
|
||||||
|
{
|
||||||
|
title: 'CKEditor',
|
||||||
|
component: 'Ckeditor'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Charts',
|
title: 'Charts',
|
||||||
component: 'Charts',
|
component: 'Charts',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
import {Component} from '@angular/core';
|
||||||
|
import {CKEditor} from 'ng2-ckeditor';
|
||||||
|
import {BaCard} from "../../../../theme/components/baCard/baCard.component";
|
||||||
|
|
||||||
|
import './ckeditor.loader.ts';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ckeditor',
|
||||||
|
directives: [CKEditor, BaCard],
|
||||||
|
template: require('./ckeditor.html')
|
||||||
|
})
|
||||||
|
|
||||||
|
export class Ckeditor {
|
||||||
|
private ckeditorContent;
|
||||||
|
private config;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.ckeditorContent = `<p>Hello CKEditor</p>`;
|
||||||
|
this.config = {uiColor: '#F0F3F4', height: '600'};
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/app/pages/editors/components/ckeditor/ckeditor.html
Normal file
7
src/app/pages/editors/components/ckeditor/ckeditor.html
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<ba-card title="ckeditor" baCardClass="with-scroll">
|
||||||
|
<ckeditor [(ngModel)]="ckeditorContent" [config]="config"></ckeditor>
|
||||||
|
</ba-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
window.CKEDITOR_BASEPATH = '//cdn.ckeditor.com/4.5.9/standard/';
|
||||||
|
require('ckeditor');
|
||||||
1
src/app/pages/editors/components/ckeditor/index.ts
Normal file
1
src/app/pages/editors/components/ckeditor/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './ckeditor.component';
|
||||||
22
src/app/pages/editors/editors.component.ts
Normal file
22
src/app/pages/editors/editors.component.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import {Component} from '@angular/core';
|
||||||
|
import {RouteConfig} from '@angular/router-deprecated';
|
||||||
|
|
||||||
|
import {Ckeditor} from "./components/ckeditor";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'editors',
|
||||||
|
template: `<router-outlet></router-outlet>`
|
||||||
|
})
|
||||||
|
|
||||||
|
@RouteConfig([
|
||||||
|
{
|
||||||
|
name: 'Ckeditor',
|
||||||
|
component: Ckeditor,
|
||||||
|
path: '/ckeditor',
|
||||||
|
useAsDefault: true
|
||||||
|
}
|
||||||
|
])
|
||||||
|
export class Editors {
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
}
|
||||||
1
src/app/pages/editors/index.ts
Normal file
1
src/app/pages/editors/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './editors.component';
|
||||||
|
|
@ -9,6 +9,7 @@ import {Maps} from './maps';
|
||||||
import {Charts} from './charts';
|
import {Charts} from './charts';
|
||||||
import {Forms} from './forms';
|
import {Forms} from './forms';
|
||||||
import {Tables} from './tables';
|
import {Tables} from './tables';
|
||||||
|
import {Editors} from "./editors";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'pages',
|
selector: 'pages',
|
||||||
|
|
@ -40,6 +41,11 @@ import {Tables} from './tables';
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
@RouteConfig([
|
@RouteConfig([
|
||||||
|
{
|
||||||
|
name: 'Editors',
|
||||||
|
component: Editors,
|
||||||
|
path: '/editors/...',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
component: Dashboard,
|
component: Dashboard,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue