Open cmeijerink opened 7 years ago
You cant do this directly through this directive as the methods would need implemented in the component. I am waiting for the owner to reply but if they have no intention of doing so i will fork and create a typescript interface and the methods for the component.
for now.... import jquery at top of component and then use
$('angular2-fullcalendar').fullCalendar('method', obj);
thnx @stevie1706,
I did get it running that way. For anybody also interested.
When working with dynamic data from a service. Do use zone->run() to force a "scope.apply()".
In my constructor: ''' this.calendarOptions.eventReceive = this.eventReceive; '''
the funcion:
private eventReceive = ( event: any ) => {
this.zone.run(() => {
........
this._callendarService.addEvent(result.event).subscribe(
result => {
this.j_calendar.fullCalendar('refetchEvents');
},
error => this.errorMessage = <any>error);
};
.............
In which j_calendar is:
@ViewChild('calendar') calendar: any;
ngAfterViewInit() {
setTimeout(() => {
this.j_calendar = <any>$(this.calendar.nativeElement);
}
........
How can i add an event by calling renderEvent?