I am new to angular so I need detailed solution to this question. I have seen a lot of answers but not according to my situation.
I have a service:
function ticketService($resource, globals) {
return $resource(globals.API_URL+'/tickets/:id', {id: '@id'}, {
update: {method: 'PUT'}
});
}
Now I need to cancel previous call when a new call is made. How I need to use timeout parameter here?
In controller im calling this service like this:
ticketService.get({group_by: type}, function(data) {
.
.
.
.
});
How I need to alter my service and controller.
Thanks.