lundi 3 avril 2017

More than one checkbox selected

My code works, if one checkbox is selected, but when 2 are select nothing is shown.

eg.: i want to show alle green and red ones, both should be shown.

Thanks!

<script src="http://ift.tt/1mQ03rn"></script>
<div class="form-group"> 
    <input type="checkbox" id="stat1" ng-true-value="'black'" ng-model="statusblack"/>&nbsp;
    <label for="stat1">black</label><br />
    <input type="checkbox" id="stat2" ng-true-value="'red'" ng-model="statusred"/>&nbsp;
    <label for="stat2">red</label><br />                               
    <input type="checkbox" id="stat3" ng-true-value="'yellow'" ng-model="statusyellow"/>&nbsp;
    <label for="stat3">yellowt</label><br />   
    <input type="checkbox" id="stat4" ng-true-value="'green'" ng-model="statusgreen"/>&nbsp;
    <label for="stat4">green</label><br />                     
</div>

<table class="table table-striped">
    <thead>
        <tr>
            <th>Number</th>
            <th>Color</th>
            <th>Info</th>
        </tr>
    </thead>
    <tbody>
        <tr ng-repeat="co in $ctrl.colors | filter:statusred | filter:statusblack | filter:statusgreen | filter:statusyellow">
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </tbody>
  </table>



Aucun commentaire:

Enregistrer un commentaire