refactor(calendar): move fullCalendar into baFullCalendar

This commit is contained in:
nixa 2016-05-20 19:44:29 +03:00
parent 6bca50b36e
commit 8e82cc57ff
9 changed files with 108 additions and 60 deletions

View file

@ -0,0 +1,25 @@
import {Component, ViewChild, ViewEncapsulation, Input, Output, ElementRef, EventEmitter} from '@angular/core';
import './baFullCalendar.loader.ts';
@Component({
selector: 'ba-full-calendar',
template: require('./baFullCalendar.html'),
encapsulation: ViewEncapsulation.None,
})
export class BaFullCalendar {
@Input() baFullCalendarConfiguration:Object;
@Input() baFullCalendarClass:string;
@Output() onCalendarReady = new EventEmitter<any>();
@ViewChild('baFullCalendar') private _selector:ElementRef;
constructor () {
}
ngAfterViewInit() {
let calendar = $(this._selector.nativeElement).fullCalendar(this.baFullCalendarConfiguration);
this.onCalendarReady.emit(calendar);
}
}

View file

@ -0,0 +1 @@
<div #baFullCalendar class="ba-full-calendar {{baFullCalendarClass || ''}}"></div>

View file

@ -0,0 +1,2 @@
require('fullcalendar/dist/fullcalendar.js');
require('style-loader!fullcalendar/dist/fullcalendar.css');

View file

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

View file

@ -6,3 +6,4 @@ export * from './baCard';
export * from './baAmChart';
export * from './baChartistChart';
export * from './baBackTop';
export * from './BaFullCalendar';