Skip to content

Instantly share code, notes, and snippets.

@Hawksbillcat
Created February 13, 2019 01:05
Show Gist options
  • Save Hawksbillcat/389ca61bc720d9da2d14adca0a64edb4 to your computer and use it in GitHub Desktop.
Save Hawksbillcat/389ca61bc720d9da2d14adca0a64edb4 to your computer and use it in GitHub Desktop.
get_data(){
let irislist_copy:Array<any>;
let irislist_recopy:Array<any>=[];
irislist_copy=this.dp.get_array();
irislist_copy.map((currentValue,index)=>{
return new Promise((resolve,reject)=>{
return this.htttp.get("http://"+irislist_copy[index].No_IP+"/cgi-bin/iris.cgi?name=").subscribe(res=>{
irislist_recopy.push({No_IP:irislist_copy[index].No_IP,
title:res["name"]+"Q",
room: res["room"]+"Q",
room_idx:irislist_copy[index].room_idx
});
console.log("irislist_recopy "+JSON.stringify(irislist_recopy))
resolve(irislist_recopy)
})
});
})
return irislist_recopy;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment