问题
I have app.ts
import moment from 'moment/moment';
import $ from "jquery";
import 'fullcalendar/fullcalendar';
$('#calendar').fullCalendar();
But having the error that $(...).fullCalendar is not a function. Hope some one can guide me to solve this. thanks!
回答1:
I had difficulty, not via angular/node, but client-side.
Ended up getting it to work via
System.config({
map: {
fullcalendar: "/js/app/fullcalendar-3.3.1/fullcalendar.min.js"
},
meta: {
fullcalendar: {
deps: [
// not sure why, but moment.js needs placed under "globals"
],
format: "global",
globals: {
moment: "/js/app/fullcalendar-3.3.1/lib/moment.min.js"
}
}
}
});
System.import("fullcalendar").then(function(){
// tada fullcalendar is loaded
$("#calendar").fullCalendar({});
});
来源:https://stackoverflow.com/questions/40184954/how-to-import-fullcalendar-v-3-0-1-with-systemjs