wilsonhobbs
wilsonhobbs

Reputation: 951

Set local storage variable with form in Ionic and Angular

I am making an app that shows content depending on a person's age. I want to set a local storage variable from a radio select. Is there a way to do this in Ionic? I have the form in a modal, with a set of radio buttons and a submit button. I also want to be able to call this variable from another controller.

Thank you.

Wilson

Upvotes: 0

Views: 468

Answers (1)

Mayank Kumar
Mayank Kumar

Reputation: 313

You can use ng-change="someFunction()" radio-button, in someFunction() you can update localStorage value or you can set $watch for your radio-button ng-model value , in $watch callback you can set value to localStorage.

Upvotes: 2

Related Questions