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
});
}