загрузить данные в $ scope.events
<script src="~/Scripts/jquery-3.3.1.js"></script>
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/Calendar/ui-bootstrap-tpls-0.9.0.js"></script>
<script src="~/Scripts/Moment/moment.js"></script>
<script src="~/Scripts/Calendar/fullcalendar.js"></script>
<script src="~/Scripts/Calendar/gcal.js"></script>
<script src="~/Scripts/Calendar/calendar.js"></script>
<style>
</style>
<script>
var app = angular.module('AppRODO', ['ui.calendar', 'ui.bootstrap']);
app.controller('CtrlRODO', function ($scope, $http, $compile, $timeout, uiCalendarConfig) {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.events = [];
$http.get('/QA/Read_Data').then(function (response) {
for (var i = 0; i < response.data.length; i++) {
response.data[i]._id = i + 1;
response.data[i].start = new Date(parseInt(response.data[i].start.match(/\/Date\(([-0-9]*)\)\//)[1]));
response.data[i].end = new Date(parseInt(response.data[i].end.match(/\/Date\(([-0-9]*)\)\//)[1]));
}
$scope.JSON = response.data;
$scope.events = $scope.JSON;
});
// $scope.events = [
// { title: 'Solo un dia', start: new Date(y, m, 1), allDay: true, },
// { id: 999, title: 'Otra', start: new Date(y, m, d + 4, 16, 0), allDay: true },
// { title: 'Rango de dias', start: new Date(y, m, 6, 19, 0), end: new Date(y, m, 10, 22, 30), allDay: true },
// ];
$scope.eventsExt = {
color: '#f00',
events: [
{ type: 'party', title: 'Finaliza', start: new Date(y, m, d, 12, 0), end: new Date(y, m, d, 14, 0), allDay: true },
{ type: 'party', title: 'Finaliza 2', start: new Date(y, m, d, 12, 0), end: new Date(y, m, d, 14, 0), allDay: true },
{ type: 'party', title: 'rodo', start: new Date(y, m, 28), end: new Date(y, m, 29), allDay: true }
]
};
$scope.Arque_Detail = function (date, jsEvent, view) {
$scope.alertMessage = (date.title + ' was clicked ');
};
/* config object */
$scope.uiConfig = {
calendar: {
firstDay: 7,
height: 500,
lang: 'es',
editable: true,
header: {
left: 'title',
center: '',
right: 'today prev,next'
},
eventClick: $scope.Arque_Detail,
}
};
/* event sources array*/
$scope.eventSources = [$scope.events, $scope.eventsExt];
/* add custom event*/
$scope.addEvent = function () {
$scope.events.push({
title: 'RODO',
start: new Date(y, m, d),
end: new Date(y, m, d),
className: ['openSesame'], allDay: true
});
};
/* remove event */
$scope.remove = function (index) {
$scope.events.splice(index, 1);
};
});
</script>