@DamoKane wrote:
Hi, I’m completely new to Ionic and have got stuck at the switch statement with a button.
What I want to happen is to save a selection from a radio group on a settings page and then launch a page based on that selection from a button click on the home page.
The app takes a news feed from 3 different sources and the user can select which one through a radio group on the settings page.
At the moment I have 3 different buttons set up but I want to have one only and then the user can choose which page loads when they click the button.launchNews(){ this.navCtrl.push(NewsPage); } launchSport(){ this.navCtrl.push(BbcsportPage); } launchGeographic(){ this.navCtrl.push(GeographicPage); }
I want to put the above code in a switch statement but each time I get an error so any help at all would be greatly appreciated
The radio group comes from the SettingsPage and is coded like this
<ion-list radio-group [(ngModel)]="newsSources"> <ion-list-header> Sources </ion-list-header> <ion-item> <ion-label>Reuters</ion-label> <ion-radio value="Reuters1"></ion-radio> </ion-item> <ion-item> <ion-label>National Geographic</ion-label> <ion-radio value="National Geographic1"></ion-radio> </ion-item> <ion-item> <ion-label>BBC Sport</ion-label> <ion-radio value="BBC Sport1"></ion-radio> </ion-item> </ion-list>
Posts: 2
Participants: 2