Menu popover


#1

I need to create a popover menu ,but it triggers an error :slight_frown:
error : PopoverCmp ionViewPreLoad error: No component factory found for PopoverPage
cheval.ts

@Component({
  template: `
    <ion-list>
      <ion-list-header>Ionic</ion-list-header>
      <button ion-item >Learn Ionic</button>
      <button ion-item >Documentation</button>
      <button ion-item >Showcase</button>
      <button ion-item >GitHub Repo</button>
    </ion-list>
  `
})

export class PopoverPage {
  constructor(private navParams: NavParams) {}
}

@Component({
  selector: 'page-cheval',
  templateUrl: 'cheval.html'
})
export class ChevalPage {
@ViewChild('popoverContent', { read: ElementRef }) content: ElementRef;
  @ViewChild('popoverText', { read: ElementRef }) text: ElementRef;    

  presentPopover(ev) {

    let popover = this.popoverCtrl.create(PopoverPage);

    popover.present({
      ev: ev
    });
  }

}

cheval.html

   <button ion-button (click)="presentPopover($event)"s>
            <ion-icon name="search"></ion-icon>
          </button>
    </ion-buttons>

#2

You added PopoverPage to both declarations and entryComponents of your app module?


#3

No, how do i do !!!


#4

@amine216 no thanks?


#5

why?..!!!


#6

@amine216 see @rapropos answer above, your code has some simple issue


#7

This good i solve the problem
Have my problem how to pass the data to the popover


#8

You could eventually say thank you, and please in that order :slight_smile:


#9

Hh desole,
thank you