angular – currentView.start为null fullcalendar

前端之家收集整理的这篇文章主要介绍了angular – currentView.start为null fullcalendar前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用Primeng的计划组件来显示具有计划功能的日历.但我一直得到以下错误

ORIGINAL EXCEPTION: TypeError: Cannot read property 'clone' of null
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'clone' of null
    at _fetchEventSource (http://localhost:8100/build/js/fullcalendar.js:10703:16)
    at fetchEventSource (http://localhost:8100/build/js/fullcalendar.js:10635:3)
    at fetchEvents (http://localhost:8100/build/js/fullcalendar.js:10629:4)
    at fetchAndRenderEvents (http://localhost:8100/build/js/fullcalendar.js:9789:3)
    at getAndRenderEvents (http://localhost:8100/build/js/fullcalendar.js:9780:4)
    at renderView (http://localhost:8100/build/js/fullcalendar.js:9671:6)
    at initialRender (http://localhost:8100/build/js/fullcalendar.js:9588:3)
    at Calendar_constructor.render (http://localhost:8100/build/js/fullcalendar.js:9552:4)
    at HTMLDivElement.<anonymous> (http://localhost:8100/build/js/fullcalendar.js:53:13)
    at Function.each (http://localhost:8100/build/js/jquery.min.js:2:2813)

在进一步调试时,我发现currentView.start为null,同样设置为rangeStart,这是在fetchEventSource中调用clone的属性.我正在使用defaultview月份.我已经没想完了.请帮帮我.
P.S我正在尝试角度2.我使用的是fullCalendar版本2.7.3. jquery的版本是3.0.0,moment.js的版本是2.13.1.

以下代码导致错误.它是fullCalendar.js的一部分.

function _fetchEventSource(source,callback) {
        var i;
        var fetchers = FC.sourceFetchers;
        var res;

        for (i=0; i<fetchers.length; i++) {
            res = fetchers[i].call(
                t,// this,the Calendar object
                source,rangeStart.clone(),rangeEnd.clone(),options.timezone,callback
            );

            if (res === true) {
                // the fetcher is in charge. made its own async request
                return;
            }
            else if (typeof res == 'object') {
                // the fetcher returned a new source. process it
                _fetchEventSource(res,callback);
                return;
            }
        }
.....

解决方法

我试图包含 angular-ui / fullcalender时遇到了这个问题.这个模块的最后一个版本(1.0.2)依赖于jQuery 2.x并且不能与jQuery 3.x一起使用.根据 this,与jQuery 3一起使用的第一个版本的fullcalender是v2.8.0.

我决定回到jQuery 2.1.4,但如果你需要它,你可以使用
现任主分公司.它在版本2.9.x中使用fullcalender.

希望这可以帮助!

猜你在找的Angularjs相关文章