mattlewis92/angular-bootstrap-calendar

TypeError in refreshCalendar () of angular-bootstrap-calendar

Closed this issue · 2 comments

Bug description:

Hi @mattlewis92 ,
while using the angular-bootstrap-calendar in my app, i got the below error in console twice. when debugs, I found that the error seems to appears because the vm .events[] array has undefined value for the first 2 time. only for the third time i got my events in that array. so the third time the forEach error doesnt appears & the events displayed correctly in the calendar. please help me by solving this issue.

TypeError: Cannot read property 'forEach' of undefined
at refreshCalendar (angular-bootstrap-calendar-tpls.js:327)
at Scope.$digest (angular.js:17800)
at Scope.$apply (angular.js:18066)
at HTMLAnchorElement. (angular.js:26678)
at HTMLAnchorElement.dispatch (jquery.js:4737)
at HTMLAnchorElement.elemData.handle (jquery.js:4549)
(anonymous) @ angular.js:14324

Versions

Angular: 1.6.0

Calendar library: angular-bootstrap-calendar 0.27.2

Browser name and version: Google Chrome 55.0.2883.87 m

  • [ ]

Please upgrade to 0.27.3 as it has ng 1.6 compatibility: 76a7fab

You should probably also initialise your events array to vm.events = []

Thanks @mattlewis92 .......