When calling a method from the home.html file, I have encountered an issue.
(click)="openPage(EventsPage)"
I understand that using this method alone will work:
openPage() {
this.navCtrl.push(EventsPage)
}
What I want to achieve is to handle different arguments based on what is clicked, while still utilizing only one method to navigate to the selected page. For example:
(click)="openPage(EventsPage)"
(click)="openPage(TimetablePage)"
openPage(page) {
this.navCtrl.push(page)
}
I am considering using a switch statement or if statements. However, I prefer to keep it concise within one or two lines of code.
If you have any suggestions or advice, I would greatly appreciate it. Thank you.