Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //第一頁
- pair=[];
- constructor(public navCtrl: NavController, public navParams: NavParams,public model:ModalController,private storage: Storage,private nativestorage:NativeStorage) {
- this.NameOfList=["A19 LED BULB RGBW","Philla Door Lock","In-Wall Fan Control"]
- this.pair.length=0;
- for(let i=0;i<this.NameOfList.length;i++){
- this.pair.push({ outer_name:this.NameOfList[i],
- user_device:"",
- user_room:"",
- group:false,
- })
- }
- }//在建構式裡面先設定好
- press(index:number){//換頁 同時傳ARRAY跟INDEX
- this.nativestorage.setItem("ppp",this.pair)
- this.navCtrl.push(PairRoomPage,{id:index,NameOfList:this.NameOfList})
- }
- ooo(){//在第一頁下面有個按鈕 在這裡查看(但都沒變)
- let mm=this.nativestorage.getItem("ppp").then(mm=>{
- console.log(mm)
- })
- }
- /********************************下面是第二頁*******************************/
- oop(){//從上一頁面傳來的INDEX+ARRAY
- let id=this.navParams.get("id")
- let b=this.nativestorage.getItem("ppp").then(data=>{
- console.log(data)
- console.log(data[id])
- data[id].group=true;
- })
- }
Add Comment
Please, Sign In to add comment