Skip to content

Instantly share code, notes, and snippets.

@scottopolis
Last active June 26, 2018 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottopolis/1909561873faaabadf20afb4891c18c2 to your computer and use it in GitHub Desktop.
Save scottopolis/1909561873faaabadf20afb4891c18c2 to your computer and use it in GitHub Desktop.
AppPresser ion-segment
<!-- add this code to a custom HTML page, change out your variables and lists -->
<ion-segment [(ngModel)]="event">
<ion-segment-button value="schedule">
Schedule
</ion-segment-button>
<ion-segment-button value="speakers">
Speakers
</ion-segment-button>
<ion-segment-button value="sponsors">
Sponsors
</ion-segment-button>
</ion-segment>
<!-- This is the default when the page is loaded -->
<div *ngIf="!event">
<ap-list route="https://reactordev.com/apv3/wp-json/wp/v2/schedule?per_page=9"></ap-list>
</div>
<!-- these are the segments -->
<div [ngSwitch]="event">
<div *ngSwitchCase="'schedule'">
<ap-list route="https://reactordev.com/apv3/wp-json/wp/v2/schedule?per_page=9"></ap-list>
</div>
<div *ngSwitchCase="'speakers'">
<ap-list route="https://reactordev.com/apv3/wp-json/wp/v2/speakers?per_page=9"></ap-list>
</div>
<div *ngSwitchCase="'sponsors'">
<ap-list route="https://reactordev.com/apv3/wp-json/wp/v2/sponsors?per_page=9"></ap-list>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment