分配我有一個複選框,以顯示停用的帳戶,當請求被選中的複選框我需要發送activationstatus虛假用於顯示禁用帳戶,未選中時,它應該通過價值爲真。我的複選框只是在初始化$ scope.checkedStatus = true之後傳遞相同的值。值不會傳遞爲false。值不會自動在複選框
HTML:
<div>
<input type="checkbox" ng-model="checkedStatus" ng-click = "viewAccount">
Show Deactivated Account
</div>
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,
"orderby": "desc",
"offset":$scope.pagination
}
}
}
};
UserService.viewListAccount(json).then(function(response) {
if (response.json.response.statuscode == 0)
{
$scope.tableData = response.json.response.data;
}
});
};
自動複選框是不會改變的價值。
這會帶來什麼變化,反正它指的是相同的功能儀式? –
是的。你可以安慰checkedStatus的輸出在功能 –
這裏是樣品(的jsfiddle)http://jsfiddle.net/cLenjedL/7/ –