Skip to content

Instantly share code, notes, and snippets.

bb:number[]=[0,1,2,3,4]
<p> {{bb[0]}} </p>
<ion-range [(ngModel)]="bb[0]">
<ion-icon range-left small name="sunny"></ion-icon>
<ion-icon range-right name="sunny"></ion-icon>
</ion-range>
<p> {{bb[1]}} </p>
/* 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
<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>
@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
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"}]
]
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=>{
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,