jeudi 22 septembre 2016

Handling Checkbox in angular js

 div class ="col-lg-5 stylethistitle"> 
 <input type=" checkbox" ng-model = "checkedStatus">Show Deactivated Account</div> 

I need to pass $scope.checkedStatus in my json request as false when it is selected and true when it is unselected.

I need that for showing deactivated accounts.

Included my JS Below

JS :

$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;

                        }

            }); 
        };




Aucun commentaire:

Enregistrer un commentaire