![](/img/trans.png)
[英]Angular 4 - ERROR in Cannot read property 'length' of undefined
[英]Angular7 FullCalendar error: Cannot read property 'length' of undefined
我正在干凈的Angular 7.2.0應用程序上試用FullCalendar 4.3版。 我正在遵循這份官方指南 。 當我加載一個簡單的空日歷時,它可以正常工作。 一旦添加任何事件並且應該顯示該事件,它將引發錯誤而不顯示該事件。
具有事件的完整日歷(從文檔中復制):
<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 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)
我在github上找到了這個示例角度項目 ,效果很好。 我從scatch重新創建了項目,將FullCalendar版本更新為4.3.0(最新),沒有任何問題。 我無法弄清楚原始應用程序出了什么問題,但是,如果有人無法正常工作,則示例項目會有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.