I am using that https://github.com/angular-ui/ui-calendar to use the FullCalendar in Angularjs.
It displays the calendar and showing no errors;
<div class="calendar" ng-model="eventSources" id="eventCalendar" calendar="calendar" config="uiConfig.calendar" ui-calendar="uiConfig.calendar"></div>
but it wont display the events, i am not sure if i am doing it right, but it shows no error and i search through the internet and didnt find a solution yet. Could anybody give me a hint why its not working?
Here is the code snippet:
var calApp = angular.module('usercalapp', ['ui.bootstrap','dialogs','ngCookies','ui.calendar']);
calApp.controller('UserCtrl', function ($scope, $http, $rootScope, $timeout,,$dialogs,$cookieStore,$compile,uiCalendarConfig)
{
$scope.eventSources = [];
$scope.calendar = $('#calendar');
$scope.uiConfig = {
calendar : {
height: 450,
editable: true,
header: {
left: 'month basicWeek basicDay',
center: 'title',
right: 'today prev, next'
},
dayClick: $scope.alertEventOnClick,
eventDrop: $scope.alertOnDrop,
eventResize: $scope.alertOnSize
}
};
$scope.cal_func = function()
{
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.eventSources = [
{
title: 'All Day Test Event',
start: new Date(y, m, 1)
},
{
title: 'Long Test Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
title: 'Test Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
}];
$scope.calendar.fullCalendar('refetchEvents');
};
$scope.showColorPicker = function(index)
{
$cookieStore.showuserid = index;
dlg = $dialogs.create('/dialogs/pickColor.html','pickColorCtrl',{},{key:false ,back:'static'});
dlg.result.then(function()
{
$scope.cal_func();
});
};
....
so i wanted that the user chooses a color, and then 3 events should show up in the Calendar, but nothing happens...