I have a div, where I show a list of users that I can invite to my auction. The list is loaded from DB
All works fine, I want to check all the label and not the checkbox, so i do something like this:
<div ng-show="showBid" class="panel panel-default">
<div class="panel-heading">Invite Members</div>
<div class="panel-body">
<div ng-repeat="user in users">
<div class="user">
<input type="checkbox" ng-model="user.isChecked" ng-change="insertinvited(user)" name="checkbox" class="checkbox" id="checkbox">
<label class="col-md-4" ng-hide="user.name == profile" for="checkbox">
<img ng-src="{{user.img}}" class="userImage">
<div class="username"> {{user.name}}</div>
<div class="userrole"> {{user.role}} </div>
<div class="usercompany">{{user.company}}</div>
</label>
</div>
</div>
</div>
</div>
and i do this on the css:
label {
display: block;
cursor: pointer;
}
.checkbox {
display: none;
}
.checkbox:checked + label {
background-color: lightseagreen;
}
But this works only for the first user, it not works for the others