Angular-UI-Calendar TypeError:无法读取属性' length'未定义的

时间:2014-04-14 17:05:53

标签: angularjs fullcalendar angular-ui

我反复收到此错误,但一旦应用程序完全初始化,它就可以正常工作。 环境: liveaddress.js jquery 1.10.2 jqueryui 1.10.4 角1.2.15(基础,-route,-cookies,-resource,-sanitize) 基础 基金会TPLS-0.1.0 modernizr 5.2.1 fullcalendar 1.6.4 angular-ui-calendar 0.8.0

我已经拿出了这些,但没有变化。

源JSON如下所示:

[{"title":"A Night in Old Havana","start":"2013-04-21T07:00:00Z","status":"COMPLETED","id":"aa4af241f9c0bc3375921a9c82f33dc6","unix_start":1366527600},{"title":"A Test Event","start":"2014-02-14T08:00:00Z","status":"BID","id":"fe2ce779b1817a56718aa62774f0f58b","unix_start":1392364800},{"title":"A Very Nice Party","start":"2014-04-04T07:00:00Z","status":"ACTIVE","id":"5bf965595ef247a6f922b930220172ad","unix_start":1396594800},{"title":"Birthday Party for Anne Marie","start":"2014-04-06T07:00:00Z","status":"ACTIVE","id":"5cd30308871bd4465fdcf7219707fd12","unix_start":1396767600},{"title":"A test event","start":"2014-05-01T07:00:00Z","status":"BID","id":"fc1cd8ae2d328e948520d5fee695c7e3","unix_start":1398927600}]

加载控件时会发布错误,收到初始数据加载后会再次发生错误,并且每当路径更改为显示日历时(部分显示)。

有什么想法吗?就像我说的那样,最终它运作良好 - 但错误让我感到烦恼。

由于

1 个答案:

答案 0 :(得分:2)

您可能在ui-calendar元素上遗漏了模型。来自docs

  

需要创建事件源对象以传递到ng-model。将监视此对象的更改并相应地更新日历,为日历提供一些Angular Magic。

     

...

<div ui-calendar="calendarOptions" ng-model="eventSources" calendar="myCalendar">

以下是FullCalendar eventSources docs的链接。