0
ここで私は1として店舗IDを渡すつもりだと0.Hereは= '1' STORE_IDはバンガロールとSTORE_ID = '0' ハイデラバードなど..ここ名前をポップオーバーに表示する方法は?
は私のhtmlコードです:
home.ts
presentPopover(myEvent) {
let popover = this.popoverCtrl.create(Popoverpage);
popover.present({
ev: myEvent
});
}
home.html
<ion-header>
<button ion-button icon-only (click)="presentPopover($event)" >
Choose City
<ion-label>{{cityname}}</ion-label>
<ion-icon name="arrow-dropdown" item-right></ion-icon>
</button>
</ion-header>
ここで「bengaluru」をクリックすると、popoverにその名前を表示し、「hyderabad」と同じ名前を表示する必要があることを意味します。
popoverpage.ts
@Component({
template: `
<ion-list>
<button ion-item (click)="store()">Bengaluru</button>
<button ion-item (click)="fun()">Hyderabad</button>
</ion-list>
`
})
export class Popoverpage{
store_id
cityname
constructor(public viewCtrl: ViewController,
public navCtrl: NavController,
public rest: Rest,
public logger: Logger) {
}
store() {
let storeObj={
store_id: '1'
}
this.logger.debug("checking the " +JSON.stringify(storeObj));
this.rest.post('/store',storeObj)
.subscribe(result => {
this.logger.debug("checking the data "+JSON.stringify(result));
if(result.status == '1'){
this.logger.info("success callback");
this.cityname="Bengaluru";
//this.navCtrl.pop();
this.viewCtrl.dismiss();
}
else{
this.logger.info("error callback");
this.viewCtrl.dismiss();
}
})
}
fun() {
let storeObj={
store_id: '0'
}
this.logger.debug("checking the " +JSON.stringify(storeObj));
this.rest.post('/store',storeObj)
.subscribe(result => {
this.logger.debug("checking the data "+JSON.stringify(result));
if(result.status == '1'){
this.logger.debug("success callback");
this.cityname="Hyderabad";
//this.navCtrl.pop();
this.viewCtrl.dismiss();
}
else{
this.logger.debug("error callback");
this.viewCtrl.dismiss();
}
})
}
}
すべてのボディはこれに返信してください知っていれば...
問題点を教えてください。 –
問題をクリックして都市を選択すると、そのドロップダウンでドロップダウンが表示されます。ベンガルールまたはハイデラバードをクリックするとその名前が表示されます。 – balu
は都市を選択するという意味で、 – balu