javascript - How to check first checkbox from ng-repeat loop in angular js? -


filters, want select first 1 radio button.

restorent1 ✔ | restorent 2 | restorent3 | restorent4

<div ng-repeat="restorent_type in restaurant_types" style="margin:5px;" class="col col-offset-10">     <label class="item item-radio radio-label {{restorent_type.rescod}}">         <input type="radio" name="group" ng-model="restorent.types" value="{{restorent_type.rescod}}" ng-click="filters.rescod = restorent_type.rescod">         <div class="item-content">             {{restorent_type.rescod}}         </div>         <i class="radio-icon ion-checkmark"></i>     </label> </div> 

you can use $first also

<div ng-repeat="restorent_type in restaurant_types" style="margin:5px;" class="col col-offset-10">     <label class="item item-radio radio-label {{restorent_type.rescod}}">         <input type="radio" name="group" ng-model="restorent.types" value="{{restorent_type.rescod}}" ng-click="filters.rescod = restorent_type.rescod" ng-checked="$first">                <div class="item-content">             {{restorent_type.rescod}}         </div>         <i class="radio-icon ion-checkmark"></i>     </label> </div> 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -