Navigation with ionic2 Popover


#1

Want to give navigation to popover Item.How to call method of different component as here in the case of change_status? Below is snippet of my code.

@Component({
template: <ion-list class="popover-page"> <ion-item (click)="change_status()"> <ion-label>Change Status</ion-label> </ion-item> </ion-list>
})
class PopoverPage {
contentEle: any;
textEle: any;
constructor(private navParams: NavParams) {
}
ngOnInit() {
if (this.navParams.data) {
this.contentEle = this.navParams.data.contentEle;
this.textEle = this.navParams.data.textEle;

}

}
}
@Component({
templateUrl: ‘build/pages/service-detail/service-detail.html’,
providers: [HTTP_PROVIDERS, CommonService],
})
class ServiceDetailPage {
@ViewChild(‘popoverContent’, {read: ElementRef}) content: ElementRef;
@ViewChild(‘popoverText’, {read: ElementRef}) text: ElementRef;

constructor(private nav: NavController, private navParams: NavParams) {

}

change_status()
{
console.log(‘I am in change status method’);
}

presentPopover(ev) {
let popover = Popover.create(PopoverPage, {

});

this.nav.present(popover, {
  ev: ev
});

}


#2

Hi Guys,

any comment?


#3

i got the solution, Please close the case.

Thanks


#4

Hi,
Can you share your solution ?

Thanks