feat(app\pages): add editor page and ckeditor

This commit is contained in:
tibing 2016-06-30 14:21:06 +03:00
parent 9af0e22650
commit dbbac18846
10 changed files with 75 additions and 1 deletions

View file

@ -7,6 +7,18 @@ export const menuItems = [
expanded: false,
order: 0
},
{
title: 'Editors',
component: 'Editors',
icon: 'ion-edit',
order: 100,
subMenu: [
{
title: 'CKEditor',
component: 'Ckeditor'
}
]
},
{
title: 'Charts',
component: 'Charts',

View file

@ -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'};
}
}

View 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>

View file

@ -0,0 +1,2 @@
window.CKEDITOR_BASEPATH = '//cdn.ckeditor.com/4.5.9/standard/';
require('ckeditor');

View file

@ -0,0 +1 @@
export * from './ckeditor.component';

View 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() {
}
}

View file

@ -0,0 +1 @@
export * from './editors.component';

View file

@ -9,6 +9,7 @@ import {Maps} from './maps';
import {Charts} from './charts';
import {Forms} from './forms';
import {Tables} from './tables';
import {Editors} from "./editors";
@Component({
selector: 'pages',
@ -40,6 +41,11 @@ import {Tables} from './tables';
`
})
@RouteConfig([
{
name: 'Editors',
component: Editors,
path: '/editors/...',
},
{
name: 'Dashboard',
component: Dashboard,