My Technical Notes

Friday, 21 August 2015

Angular Radio Button Snippet

Given the following markup:


<label for="resolved-all">
    <input type="radio" ng-model="item.resolved" value="" id="resolved-all" />All
</label>
<label for="resolved-true">
    <input type="radio" ng-model="item.resolved" value="true" id="resolved-true" />Yes
</label>
<label for="resolved-false">
    <input type="radio" ng-model="item.resolved" value="false" id="resolved-false" />No
</label>

In our controller we can have the statement:


$scope.item = {
    resolve: "true"
};

No comments: