angularjs中的$event事件
<tr>
<th class="" style="padding-right:0px">
<input id="selall" type="checkbox" class="icheckbox_square-blue">
</th>
<th class="sorting_asc">品牌ID</th>
<th class="sorting">品牌名称</th>
<th class="sorting">品牌首字母</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="l in list" >
<td><input type="checkbox" ng-click="updateIds($event,l.id)" ></td>
<td>{{l.id}}</td>
<td>{{l.name}}</td>
<td>{{l.firstChar}}</td>
<td class="text-center">
<button type="button" class="btn bg-olive btn-xs" data-toggle="modal" data-target="#editModal" ng-click="findOne(l.id)" >修改</button>
</td>
</tr>
</tbody>
</table>
$scope.updateIds=function($event,id){
if($event.target.checked){//判断是否选中
$scope.selectIds.push(id);//选中往数组里添加id信息
}else{
var idx = $scope.selectIds.indexOf(id);//获取要删除的id下标
$scope.selectIds.splice(idx,1);//idx:要删除的下标,1表示从当前下标往后删除的个数 一般是1个
}
}
==$event.target代表能够直接选取到checkbox对象 ==