I'm new to Ionic. I'm really stuck in one issue for past 2 days. I've two pages application. Say HomePage and SettingsPage.
In SettingsPage, I've got a radio group with 4 radio buttons. Once is selected by default. When I'm clicking on another radio, that is being selected, however, once I leave that page, say I go to HomePage, and come back again, I find the default value to be selected and not the one I actually selected.
How can I make my selected value persistent even if I leave the SettingsPage?
Below is the code:
<ion-list radio-group (ionChange)="radiochanged($event)">
<ion-item item-left>
<ion-label>5 Seconds</ion-label>
<ion-radio value="5000" (ionChange) = "radiofivechanged()"
[checked]="check5" ></ion-radio>
</ion-item>
<ion-item item-left>
<ion-label>8 Seconds</ion-label>
<ion-radio value="8000" [checked] = "check8" ></ion-radio>
</ion-item>
<ion-item item-left>
<ion-label>12 Seconds</ion-label>
<ion-radio value="12000" [checked]="check12" ></ion-radio>
</ion-item>
<ion-item item-left>
<ion-label>15 Seconds</ion-label>
<ion-radio value="15000" [checked]="check15" ></ion-radio>
</ion-item>
</ion-list>
settingspage.ts
check5, check8, check12, check15 : boolean;
radiofivechanged(){
this.check5 = true;
this.check8 = false;
this.check12 = false;
this.check15 = false;
}