[英]Angular7 FullCalendar error: Cannot read property 'length' of undefined
I am trying out FullCalendar version 4.3 on a clean Angular 7.2.0 application. 我正在干净的Angular 7.2.0应用程序上试用FullCalendar 4.3版。 I am following this official guide .
我正在遵循这份官方指南 。 When I load a simple empty calendar, it works fine.
当我加载一个简单的空日历时,它可以正常工作。 As soon as I add any events AND the event should be displayed, it throws an error without displaying the event.
一旦添加任何事件并且应该显示该事件,它将引发错误而不显示该事件。
full calendar with events (copied from documentation): 具有事件的完整日历(从文档中复制):
<full-calendar
defaultView="dayGridMonth"
[plugins]="calendarPlugins"
[weekends]="false"
[events]="[
{ title: 'event 1', date: '2019-08-06' },
{ title: 'event 2', date: '2019-08-07' }
]"
></full-calendar>
Error: 错误:
ERROR TypeError: Cannot read property 'length' of undefined
at DayGridView.push../node_modules/@fullcalendar/core/main.esm.js.View.computeEventDraggable (main.esm.js:7575)
at DayGridEventRenderer.push../node_modules/@fullcalendar/daygrid/main.esm.js.SimpleDayGridEventRenderer.renderSegHtml (main.esm.js:218)
at DayGridEventRenderer.push../node_modules/@fullcalendar/core/main.esm.js.FgEventRenderer.renderSegEls (main.esm.js:7799)
at DayGridEventRenderer.push../node_modules/@fullcalendar/core/main.esm.js.FgEventRenderer.renderSegs (main.esm.js:7763)
at DayGrid.res [as renderFgEvents] (main.esm.js:3183)
at DayGrid.push../node_modules/@fullcalendar/daygrid/main.esm.js.DayGrid.render (main.esm.js:742)
at DayGrid.push../node_modules/@fullcalendar/core/main.esm.js.Component.receiveProps (main.esm.js:3881)
at SimpleDayGrid.push../node_modules/@fullcalendar/daygrid/main.esm.js.SimpleDayGrid.render (main.esm.js:1518)
at SimpleDayGrid.push../node_modules/@fullcalendar/core/main.esm.js.Component.receiveProps (main.esm.js:3881)
at DayGridView.push../node_modules/@fullcalendar/daygrid/main.esm.js.DayGridView.render (main.esm.js:1584)
I found this example angular project on github which works fine. 我在github上找到了这个示例角度项目 ,效果很好。 I recreated the project from scatch, updating the FullCalendar version to 4.3.0 (latest) without any problems.
我从scatch重新创建了项目,将FullCalendar版本更新为4.3.0(最新),没有任何问题。 I can't figure out what went wrong in the original app, however if anyone's having trouble getting it to work, the example project will help.
我无法弄清楚原始应用程序出了什么问题,但是,如果有人无法正常工作,则示例项目会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.