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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -