Created
March 16, 2015 18:25
-
-
Save aderowbotham/1009538a95846a344aab to your computer and use it in GitHub Desktop.
Use Radio buttons for a boolean with Angular 1.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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