**我需要獲取文件夾數組中選中的複選框值,因此我使用了ng模型。但它似乎不起作用。 **我需要在「列名:」數組。columnvalue」格式,但是這將是下一步,我必須從第一我想使用angularjs獲取複選框列表中的所有選定的值
<div ng-repeat="filter in searchfilters|limitTo:4">
<div class="row form-inline advanced-search-division">
<span class="col-md-3 col-xl-3 col-lg-3 col-sm-12">
<label for="PriorityCheckbox" class="task-content-text"> {{filter.ColumnName}}</label>
</span>
<span class="col-md-9 col-xl-9 col-lg-9 col-sm-12">
<span ng-repeat="value in filter.ColumnValue" >
<span ng-if="value !== ' '" class="checkbox-inline">
<label class="task-content-text" style="margin-right:50px"><input type="checkbox" ng-model="folder[value]" /> {{value}}</label>
</span>
<span ng-if="value == ' ' ">
<input type="text" />
</span>
</span>
</span>
</div>
</div>
angular.module("AMYApp").controller("advancedSearchController", function ($scope, $http) {
$scope.searchfilters = [{ "ColumnName": "AAAFramework", "ColumnValue":" ", "TableName": "AAAFrameworkMaster" },
{ "ColumnName": "TechnologyPlatform", "ColumnValue": ["SAP","Mobile","Web-Webforge","Web-Other","Quickbase","SharePoint","Other"], "TableName": "TechnologyPlatformMaster" },
{ "ColumnName": "CriticalBusinessProcess", "ColumnValue": ["Yes","No"], "TableName": "CriticalBusinessProcessMaster" },
{ "ColumnName": "ApplicationSize", "ColumnValue": ["Small", "Medium", "Large", "MEGA"], "TableName": "ApplicationSizeMaster" }
]
$scope.folder = [];
}
<div ng-repeat="filter in searchfilters|limitTo:4">
<div class="row form-inline advanced-search-division">
<span class="col-md-3 col-xl-3 col-lg-3 col-sm-12">
<label for="PriorityCheckbox" class="task-content-text">{{filter.ColumnName}}</label>
</span>
<span class="col-md-9 col-xl-9 col-lg-9 col-sm-12">
<span ng-repeat="value in filter.ColumnValue" >
<span ng-if="value !== ' '" class="checkbox-inline">
<label class="task-content-text" style="margin-right:50px"><input type="checkbox" ng-model="folder[value]" /> {{value}}</label>
</span>
<span ng-if="value == ' ' ">
<input type="text" />
</span>
</span>
</span>
</div>
</div>
使用'NG-checked' –