Reputation: 467
I am trying to integrate FullCalendar in an Angularjs 2 application. I did search for an example where some have done it already, but could not find any examples for Angularjs 2. Can some one point me in the right direction. I am getting following error when the application loads up.
TypeError: b.class is not a constructor
at Pa.Calendar.ra.extend.instantiateView (http://localhost:5555/node_modules/fullcalendar/dist/fullcalendar.min.js?1459824069953:8:28997)
Following is my controller code.
export class TestComponent implements OnInit, AfterContentInit {
date:Date = new Date();
ngAfterContentInit() {
var calendarDiv: any = $('#calendar');
calendarDiv.fullCalendar({
defaultView: 'timelineMonth',
events: [
],
resources: [
]
// other options go here...
});
}
ngOnInit() {
console.log('On init ! ');
$('#calendar').text('Hi I am replace');
}
Template code:
<div id='calendar'>Test calendar</div>
Thanks.
Upvotes: 0
Views: 859
Reputation: 467
Finally figured out what was wrong. I was using the incompatible version of jquery, fullcalendar and fullcalendar-scheduler. Used the FullCalendar demo(from the official website) to figure out the versions required.
Upvotes: 1