import { Component , Input , OnInit , AfterViewInit , AfterContentChecked , AfterViewChecked , ElementRef } from '@angular/core' ; import * as $ from 'jquery' ; import 'fullcalendar' ; import { Options } from "fullcalendar" ; @ Component ( { template : '<div></div>' , selector : 'angular2-fullcalendar' } ) export class CalendarComponent implements OnInit , AfterViewInit , AfterContentChecked , AfterViewChecked { @ Input ( ) options : Options ; text : string ; calendarInitiated : boolean ; constructor ( private element ) { } ngOnInit ( ) { console . log ( "ngOnInit" ) ; } ngAfterViewInit ( ) { setTimeout ( ( ) => { $ ( 'angular2-fullcalendar' ) . fullCalendar ( this . options ) ; } , 100 ) ; } ngAfterContentChecked ( ) { } ngAfterViewChecked ( ) { } updateEvent ( event ) { return $ ( this . element . nativeElement ) . fullCalendar ( 'updateEvent' , event ) ; } clientEvents ( idOrFilter ) { return $ ( this . element . nativeElement ) . fullCalendar ( 'clientEvents' , idOrFilter ) ; } }