【问题标题】:ng-fullcalendar title have undefinedundefined in angular 5ng-fullcalendar 标题在角度 5 中有 undefinedundefined
【发布时间】:2020-01-03 14:45:34
【问题描述】:

我在我的 Angular 5 项目中使用 ng-fullcalendar。 我使用了与完整日历网站中提到的代码相同的代码。 这是我的 npm 版本和代码,以便更好地了解我的问题。

package.json

这是我的 package.json 文件的一瞥

"fullcalendar": "^3.6.1", "ng-fullcalendar": "^1.4.0", "moment" : latest,

fullcalendar.component.html

<ng-fullcalendar #ucCalendar [options]="calendarOptions" (eventClick)="eventClick($event.detail)">
    </ng-fullcalendar>

fullcalendar.component.ts

this.valuationService.getEvents().subscribe(data => {
            this.events = data;
            this.calendarOptions = {
                editable: true,
                height: 'auto',
                eventLimit: false,
                // defaultDate: '2016-09-12',
                header: {
                    center: 'title ',
                    left: 'prev,today,next',
                    right: 'month,agendaWeek,agendaDay'
                },
                events: []
            };
        });

这是我面临的问题的图像,以便您更好地查看它。

我已经关注了一个 github 演示并使用了相同版本的包,但我仍然遇到未定义未定义的错误。我已经浏览了 stack 、github 等中给出的所有可能的解决方案,但仍然找不到正确的解决方案。

虽然我找到了一种解决方案,但为此我必须更改 node_modules 文件中 fullcandar.min.js 中的一些代码。所以这样做不是很方便。 希望您能帮助我并提前致谢。

【问题讨论】:

  • 为什么要同时导入 fullcalendar 和 ng-fullcalendar?你可以只尝试第一个,因为第二个已弃用
  • 对不起,因为我已经完成了所有可能的解决方案,所以安装其他解决方案并尝试@Dimitrios。

标签: angular fullcalendar momentjs


【解决方案1】:

存在版本问题。

但如果使用更高版本,您将不会在生产中出错。

在本地使用ng-serve 你会得到这个错误但是使用相同的版本ng build --prod 此问题将得到解决。

【讨论】:

    猜你喜欢
    • 2019-05-28
    • 2022-08-22
    • 1970-01-01
    • 1970-01-01
    • 2022-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多