Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Ionic 2 Root Controller question

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>