You can add a callback function to your list of get_category(...) parameters.
Ex:
get_categories(number, callback){
this.http.post( url, body, {headers: headers, withCredentials:true})
.subscribe(
response => {
this.total = response.json();
callback();
}, error => {
}
);
}
And then you can just call get_category(...) like this:
this.get_category(1, name_of_function);