div class ="col-lg-5 stylethistitle">
<input type=" checkbox" ng-model = "checkedStatus">Show Deactivated Account</div>
我需要在我的json請求中將$ scope.checkedStatus傳遞爲false,當它被選中時爲false,並且在未選中時爲true。處理角js中的複選框
我需要顯示停用的帳戶。
包括我的JS下面
JS:
$scope.checkedStatus = true;
$scope.viewAccount = function(){
var json = {
"json": {
"request": {
"servicetype": "6",
"functiontype": "6014",
"session_id": $rootScope.currentSession,
"data": {
"shortname": $scope.model.selectShortName,
"groupzname": $scope.model.selectGname,
"city": $scope.model.selectCity,
"state": $scope.model.selectState,
"country": $scope.model.selectCountry,
"groupzcode": $scope.model.selectGcode,
"activationstatus": $scope.checkedStatus,
"details": false,
"sortbasedon": $scope.groupzname,
"offset":$scope.pagination
}
}
}
};
$scope.sortkey='';
$scope.reverse=false;
UserService.viewListAccount(json).then(function(response) {
if (response.json.response.statuscode == 0 && response.json.response.statusmessage == 'Success')
{
$scope.tableData = response.json.response.data;
}
});
};
我這樣做,問題是將它們設置爲false時,選擇對我來說是真正的挑戰。 –
@NicoletaWilskon在傳遞它時會採取相反的值。 !($ scope.checkedStatus)會做這件事 –