2014-04-14 212 views
2

我得到這個錯誤反覆,雖然一旦應用程序完全初始化,它可以正常工作。 環境: 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.0Angular-UI-Calendar TypeError:無法讀取未定義的屬性「長度」

我已經拿出了這件作品,但沒有改變。

源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}] 

的誤差被張貼時被加載的控制,在接收到初始數據加載後再次發生,並且每當路由被改變以顯示日曆(其是部分)。

任何想法?就像我說的那樣,最終它運作良好 - 但這些錯誤讓我感到困擾。

謝謝

回答

2

您可能在ui-calendar元素上省略了模型。從docs

An Event Sources objects needs to be created to pass into ng-model. This object will be watched for changes and update the calendar accordingly, giving the calendar some Angular Magic.

...

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

這裏是到FullCalendar eventSourcesdocs的鏈接。

+0

這確實最終解決了這個問題。謝謝。當我第一次添加模型參考時,我開始在日曆中看到兩個條目,但現在它可以工作。 – JoeyR

+0

謝謝,這解決了我的問題! – richard

相關問題