Angular List refresh/update issue, while creating new list item
dashboard-controller.js - on dashboard.html
.controller('DashboardController',
function ($scope, $state, eventService, storage) {
eventService.getEventList(storage.getCurrentUser().id).then(function (response) {
c.eventList = response;
});
event-controller.js - on create-event.html
.controller('EventController',
function ($scope, $state, eventService, storage) {
this.createEvent = function () {
eventService.create(event).then(this.onResponseSuccess, this.onResponseError);
};
this.onResponseSuccess = function (payload) {
$state.go('app.dashboard');
};
Issue:
First time I can retrieve event list on Dashboard page, but once i created new event and comeback to Dashboard screen, the newly created Event is not updated on the list, When I tried to call getEventList.