@richardshergold wrote:
I expect this is easy but I am not sure what the best way of doing it is.
I have a tabbed application and a main component that displays information by date.
On tab 1 I want to display today's data and on tab 2 I want to display tomorrow's data.
Rather than have two components, one for Today and one for Tomorrow like this:
tabs.html
<ion-tabs> <ion-tab tab-title="Today" tab-icon="clock" [root]="TodayRoot"></ion-tab> <ion-tab tab-title="Tomorrow" tab-icon="fastforward" [root]="TomorrowRoot"></ion-tab> </ion-tabs>
tabs.js
export class TabsPage { constructor() { this.TodayRoot = TodayPage; this.TomorrowRoot = TomorrowPage; } }
how could I have ONE component called DataPage and pass a parameter to it from tabs.js (i.e a parameter of "Today" or "Tomorow") ?
Posts: 2
Participants: 2