How to import fullcalendar v.3.0.1 with systemjs?

…衆ロ難τιáo~ 提交于 2019-12-11 03:53:57

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!