I’m trying to set up a calendar according to the instructions. The calendar itself shows up on the page, but it doesn’t display any events.
Code in template:
<div ui-calendar ng-model="eventSources">
Code in my controller:
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.eventSources = [
{
"title": 'All Day Event',
"start": new Date(y, m, d)},
{
"title": 'Long Event',
"start": new Date(y, m, d - 5),
"end": new Date(y, m, d - 2)}];
When I loop through eventSources in the template it works:
<li ng-repeat="e in eventSources">
{{e.title}} {{e.start}}
</li>
The calendar doesn’t show anything, though. There are no errors in console, too. Does any of you has an idea of what’s going on here?
Using Just an array of events is the issue here. uiCalendar only takes an array of eventSources. http://arshaw.com/fullcalendar/docs/event_data/eventSources/
I believe that we should make it flexible enough to allow for all of the api sources however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With