如何用systemjs导入fullcalendar v.3.0.1? [英] How to import fullcalendar v.3.0.1 with systemjs?

查看:79
本文介绍了如何用systemjs导入fullcalendar v.3.0.1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有app.ts

import moment from 'moment/moment';
import $ from "jquery";
import 'fullcalendar/fullcalendar';

$('#calendar').fullCalendar();

但是有错误,$(...)。fullCalendar不是函数。
希望有人能指导我解决这个问题。
thanks!

But having the error that $(...).fullCalendar is not a function. Hope some one can guide me to solve this. thanks!

推荐答案

我有困难,不是通过angular / node,而是客户端。

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({});
});

这篇关于如何用systemjs导入fullcalendar v.3.0.1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆