vendredi 18 novembre 2016

How to check the check boxes based on the values stored in db(Angularjs)

I am able to insert values to db according to checked but i am failed to check the values while fetching from db ..can any one provide me some help.Thanks.

My template,

<div class="btn-group col-xs-4 nopadding"  ng-repeat="type in vm.bussinesstypeoptions" data-toggle="buttons">
   <label class="col-xs-12 btn btn-white" ng-click="toggleSelection(type)" ng-class="{'active': type == checkvalue.name   }">
 <input type="checkbox" name="selectbox"  value="type" ng-checked="vm.selection.indexOf(checkvalue.name) > -1"   required> 
  </label>
</div>

My values in stored in db as,

"business_type" : [ 
    "Education Consultant", 
    "Guardianship", 
    "Hotel/Home-Stay"
],




Aucun commentaire:

Enregistrer un commentaire