angular - currentView.start 为空 fullcalendar

标签 angular 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 中调用克隆的属性。我正在使用 defaultview 月份。我已经没有想法了。请帮帮我。 P.S 我正在 Angular 2 中尝试这个。我正在使用 fullCalendar version 2.7.3jquery版本为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。

希望这对您有所帮助!

关于angular - currentView.start 为空 fullcalendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37851716/

相关文章:

node.js - 更新文档时 XMLHttpRequest 错误,但应启用 CORS

javascript - 升级 angular2-cli 项目中的 angular 2 依赖项

jquery - 如何在 Angular 4 中使用工具提示并从 npm 安装 bootstrap tether jquery?

jquery - 在全日历中显示图像作为背景

javascript - 如何屏蔽 Fullcalendar 中超过特定​​日期的日期

javascript - 完整的日历更改图标以在不可编辑的事件上悬停

angular - 如何使用 ng2-ckeditor 作为内联?

angular - 如果 'ng-template' 是 Web 组件,则将 "CUSTOM_ELEMENTS_SCHEMA"添加到该组件的 以抑制此消息。 ("[错误 ->]<ng-模板>

c# - 像 MVC 中的谷歌日历这样的调度程序

javascript - 刷新日期变化的全日历 View