Skip to content

Instantly share code, notes, and snippets.

@aderowbotham
Created March 16, 2015 18:25
Show Gist options
  • Save aderowbotham/1009538a95846a344aab to your computer and use it in GitHub Desktop.
Save aderowbotham/1009538a95846a344aab to your computer and use it in GitHub Desktop.
Use Radio buttons for a boolean with Angular 1.3
<h1>How to use radio buttons to represent a boolean?</h1>
<!-- It's important to use `ng-value` for the boolean value and not just `value` -->
<h3>Enable some setting?</h3>
<label><input type="radio" ng-model="myBoolean" ng-value="false"> Yes</label>
<label><input type="radio" ng-model="myBoolean" ng-value="true"> No</label>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment