Use the ng-model directive to bind radio buttons to your application; while radio buttons can have different values, only the selected button’s value will be used.
Show some text depending on the value of the selected radio button.
<form> Pick a topic: <input type=”radio” ng-model=”myVar” value=”dogs”>Dogs <input type=”radio” ng-model=”myVar” value=”tuts”>Tutorials <input type=”radio” ng-model=”myVar” value=”cars”>Cars </form> |
The value of myVar will be either “dogs,” “tuts,” or “cars.”