I need to trigger similar to JQuery events ajaxStart and ajaxStop
I found a half solution here ->
How to set default HTTP header in Angular2?
So, at the moment i can handle an ajaxStart
Event.
Any solutions how to handle ajaxStop
event?
post(url: string, body: string, options?: RequestOptionsArgs): Observable<Response> {
//onAjaxStart
$( "#loader" ).show();
return super.post(url, body, options); //Any method here to handle event?
}
I tried to use .catch()
, but it fires only onError
I need to call my animate loader when ajax fires, and hide it when it stops every time i use ajax request.
So i am trying to override default ajax methods. But i can't find right observable method(