в моем HTML страницы:Как получить значения Mutiple значения CheckBox с помощью angularjs
<body ng-app>
<div class="wrapper wrapper-content" ng-controller="InboxMailCtrl">
<tr ng-repeat="CU in InboxList">
<td class="check-mail">
<input type="checkbox" ng-model="CU.Selected" value="{{CU.InboxMailID}}" class="i-checks" >
</td>
<td class="text-right mail-date">{{CU.time}}</td>
</tr>
<button ng-click="Delete()"></button>
</div>
</body>
и в моем файле JS:
var InboxMailCtrl = function ($scope, $http) {
BindInboxList();
function BindInboxList() {
$http({
url: "MailRoute/getDataForMailInbox",
dataType: 'json',
method: 'POST',
data: obj,
headers: {
"Content-Type": "application/json"
}
}).success(function (response) {
debugger;
$scope.InboxList = response;
}).error(function (error) {
alert(error);
});
}
$scope.Delete = function() {
debugger
$scope.MailNameArray = [];
angular.forEach($scope.InboxList, function (CU) {
if (!!CU.selected) $scope.MailNameArray .push(CU.InboxMailID);
})
}
$scope.Delete
получает выбранный ckeckbox значение деталей в MailNameArray
, но я не являюсь способный нажимать выбранные данные флажка в этот массив.
Что не так?
Я использую контроллер webAPI, а getDataForMailInbox
- это функция в контроллере api.
вы можете поместить его в скрипку или что-то еще, так что мы можем увидеть, что на самом деле происходит и должно произойти .... – MrBuggy