Skip to content

Instantly share code, notes, and snippets.

public async compair_favorite() {
const radio_list=await this.add_list();
const favrite_radio_list=await this.storage.get("love")
const confirm_playing=await this.playing_song();
const sd=await this.love_song(this.test_three);
console.log(radio_list);//can not print
}
public add_list(){ //先爬網頁上的資料
return new Promise((resolve, reject)=>{
this.httpclient.get("URL")
.subscribe(res=>{
if(res["status"]==200){
let qq:string=JSON.parse(JSON.stringify(res))
for(let i=0;i<qq["results"].length;i++){
this.test_three.push({ //這邊是爬網頁上的資料 再PUSH進去
ID:qq["results"][i].ID,
Name:qq["results"][i].Name,
async compair_phone_book(){
let test_set=[];//先塞PROMISE給ALL用
let setting=[];
let a;
return new Promise((resolve,reject)=>{
this.get_phone_book().then(res=>{
const b =JSON.parse(JSON.stringify(res));
b.map(i=>{
let b=
[
[
{"ip":"192.168.0.149","ninth":"37.4.0.122"},
{"ip":"192.168.0.19","ninth":"37.4.0.122"}
],mmmmmm
[{"ip":"192.168.0.16","ninth":"37.4.0.122"}]
]
@Hawksbillcat
Hawksbillcat / post in httpclient?
Last active May 24, 2019 12:36
post in httpclient?
let url = "http://@" + this.sRouterIP + "/config_macfilter_app.php";
let mac:string=("1c:b0:94:ae:0e:1f").toLocaleUpperCase();
let s_body=JSON.stringify({body:"action=app_block&interface=wifi0&mac=" + encodeURIComponent(mac)})
let formdata = new FormData();
formdata.append("body", s_body)
let requestOptions: Object = {
//headers: new HttpHeaders().set('Content-Type','application/x-www-form-urlencoded')//not works
<div class="QQ-all" id="QQ-all"> //this is the templet what I want
<div class="second-connect" id="down_arrow">
<img src="assets/imgs/wifi-connect.png" class="second-connect-item-down" id="down_arrow_img">
</div>
<div class="swiper-container" id="swiper-container">
<div class="swiper-wrapper" >
<div class="swiper-slide" style="background-image:url(assets/imgs/wap7531.png);" *ngFor="let con of RP_DEVICE;">
<div class="swiper-text">{{con.second}}</div>
</div>
/* HTML part
<ion-list *ngFor="let con of option,let i of index;">
<ion-select [(ngModel)]="con.value_id[i]">
<ion-option *ngFor="let c of con.value_id">{{c}}</ion-option>
</ion-select>
</ion-list>
/* json data