scheduler.controller.js
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
'use strict';
//Load controller
angular.module('acufuel')
.controller('schedulerController', ['$scope','$compile', 'uiCalendarConfig', function($scope, $compile, uiCalendarConfig) {
$scope.test = "Testing...";
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.eventList=[
{title:'Event 1'},
{title:'Event 2'},
{title:'Event 3'},
{title:'Event 4'}
];
$scope.eventSources=[];
$scope.events = [
{title: 'All Day Event', start: new Date(y, m, 1)},
{title: 'Birthday Party', start: new Date(y, m, d + 1, 19, 0), end: new Date(y, m, d + 1, 22, 30), allDay: false},
{title: 'Click for Google', start: new Date(y, m, 28), end: new Date(y, m, 29)}
];
$scope.uiConfig = {
calendar:{
height: 450,
editable: true,
droppable: true,
drop: function (date, allDay, jsEvent, ui) {
console.log('Here ,but where is the object?');
},
header:{
left: 'title',
center: '',
right: 'today prev,next'
},
eventResize: true,
}
};
$scope.eventSources = [$scope.events];
//$scope.eventSources = [];
//$scope.eventSources.push($scope.events);
$scope.addEvent = function(index) {
console.log('INDEX', index);
console.log('EVENTS', $scope.eventSources);
//$scope.events.push($scope.eventList[index]);
}
console.log($scope.eventSources);
}]);