Closed yasserht closed 7 years ago
You would just load them with $http like any other request for data and then map them to a format the calendar understands:
// GET /events returns [{title: 'event-title', start: '2017-04-01'}]
$http.get('/events').then(function(result) {
vm.externalEvents = result.data.map(function(apiEvent) {
return {
title: apiEvent.title,
type: 'warning',
color: calendarConfig.colorTypes.warning,
startsAt: new Date(apiEvent.start),
draggable: true
};
});
});
Hope that helps!
Hello @mattlewis92 I have two questions does this // GET /events returns [{title: 'event-title', start: '2017-04-01'}] give me events for that exact date ? and what if i want events for a range of dates ? thank you
Hello, I wanna ask how can I get external draggable events from a JSON file or API, also events on the calendar. here's the starter plunker : http://plnkr.co/edit/6ptfCC1k1izm76Hw8Aox?p=preview