i have referred two backend service on a success of the first service, its solved my problem for two backend services.but i have three backend services, on the success of first service, second services should call and on the success of second services, third should service call. please help me.
service.ts
Firstservice
gethrdata(param)
{
var respone: any;
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let authToken = localStorage.getItem('auth_token');
console.log(authToken);
headers.append('X-auth-Token', authToken)
return this._http.post('http://localhost:8080/ada/api/v1/client/'+param+'/hrdata', '', {headers} )
/*.map(res => res.json())*/
.map((res) => {
respone = res;
console.log(respone);
return respone;
});
}
Secondservice
getflagloa(param)
{
var respone: any;
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let authToken = localStorage.getItem('auth_token');
console.log(authToken);
headers.append('X-auth-Token', authToken)
return this._http.get('http://localhost:8080/api/v1/client/'+param+'/loa', { headers })
.map(res => res.json())
.map((res) => {
respone = res;
console.log(respone);
return respone;
});
}
Thirdservice
insertloa(param)
{
var respone: any;
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let authToken = localStorage.getItem('auth_token');
console.log(authToken);
headers.append('X-auth-Token', authToken);
/* let options = new RequestOptions({headers:headers});*/
return this._http.post('http://localhost:8080/api/v1/client/'+param+'/loadata', '', {headers} )
/*.map(res => res.json())*/
.map((res) => {
respone = res;
console.log(respone);
return respone;
});
}
now how can i call these services on success of prevoius service.