I trying to do the following without success. I am trying fire an http request/Observable depending on a previous http request result.
ngOnInit() {
this._lights.LastChannel(this.hostname).subscribe(data => {
this.LastChannel = data.Message;
this.shields = this.LastChannel / 8;
if (this.LastChannel % 8 != 0){
this.shields++;
}
for(var i=0; i < this.shields; i++){
console.log(i+1);
this.shield(i+1)
}
});
}
shield(index){
this._lights.shieldStatus(this.hostname, index)
.subscribe(data=> {
console.log(data.Message.split(' '));
console.log(data.Message)
})
}
First request runs fine, second one gets fired. Go server responds 200, but browser shows keep pending.