I am trying to implement FullCalendar Scheduler in Angular 2, and I have followed the below specified steps -
Installed the required dependancy as below -
"dependencies": {
"fullcalendar": "^3.8.0",
"fullcalendar-scheduler": "^1.9.1",
"jquery": "^3.2.1",
"moment": "^2.20.1"
},
"devDependencies": {
"@types/jquery": "^2.0.47"
}
Updated the angular-cli.json
as below -
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/fullcalendar/dist/fullcalendar.min.css",
"../node_modules/fullcalendar-scheduler/dist/scheduler.min.css",
"../node_modules/primeng/resources/primeng.min.css",
"../node_modules/primeng/resources/themes/omega/theme.css",
"../node_modules/font-awesome/css/font-awesome.min.css"
],
"scripts": ["../node_modules/jquery/dist/jquery.js",
"../node_modules/moment/min/moment.min.js",
"../node_modules/fullcalendar/dist/fullcalendar.js",
"../node_modules/fullcalendar-scheduler/dist/scheduler.min.js"
],
I have imported the dependancies in main.ts
and module.ts
-
main.ts -
import * as jQuery from "jquery";
(window as any).$ = (window as any).jQuery = jQuery;
app.component.html -
<div id='calendar'></div>
app.component.ts
import { Component } from '@angular/core';
import 'fullcalendar';
import 'fullcalendar-scheduler';
declare let $: any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
ngOnInit() {
$('#calendar').fullCalendar({});
}
}
I have solved the @type/jquery issue as specified in jQuery error anymore, however I am not able to compile the code it give below mentioned error -
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (347,6): Type 'string' is not assignable to type 'EmitterInterface[]'.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (124,27): ']' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (125,28): ']' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (125,33): ';' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (126,28): ']' expected.
ERROR in /Users/jeet/Documents/Development/frontend/node_modules/fullcalendar/dist/fullcalendar.d.ts (126,33): ';' expected.
Please find the full error here. I have already looked at below threads and resources and these doesn't seems to address the issue -
https://github.com/fullcalendar/fullcalendar/issues/3991 fullcalendar & Angular 5
I request your help regarding same.