带有复选框的Angular JS表单

时间:2016-06-07 20:12:42

标签: javascript angularjs

我有一个带有复选框的角形。

问题是:它不起作用,我不知道问题出在哪里。

<div class="inmodal">
    <div class="modal-header">
        <i class="fa fa-laptop modal-icon"></i>
        <h4 class="modal-title">PDF</h4>
        <small class="font-bold"></small>
    </div>
	<div class="modal-body">
	   <div class="checkbox checkbox-primary"><input id="checkbox2" type="checkbox" ng-model="getZZ6533"><label for="checkbox2">ZZ6533</label></div>
       <div class="checkbox checkbox-primary"><input id="checkbox2" type="checkbox" ng-model="getHH1213"><label for="checkbox2">HH1213</label></div>
       <div class="checkbox checkbox-primary"><input id="checkbox2" type="checkbox" ng-model="getMM9090Alt"><label for="checkbox2">MM9090Alt</label></div>
       <div class="checkbox checkbox-primary"><input id="checkbox2" type="checkbox" ng-model="getXL7878"><label for="checkbox2">XL7878</label></div>
            
       </div>                          
    
    <div class="modal-footer">
        <button type="button" class="btn btn-white" ng-click="cancel()">Close</button>
        <button type="button" class="btn btn-primary" value="Submit" ng-click="checkoptions(arrlist)">RUN</button>
    </div>

1 个答案:

答案 0 :(得分:0)

 function PdfllCtrl($scope, $http, DTOptionsBuilder, localStorageService, $uibModal){

    var date = localStorageService.get('daterange');
    $scope.page = "1";

    $http({
         method: 'GET',
         url: apiurl + "GetPDFll?fromDate="+date.startDate+"&toDate="+date.endDate+" 23:59:59&pageIndex="+$scope.page+"&search=",
         headers: {'Content-Type': 'application/x-www-form-urlencoded'}
    }).then(function(response){
         $scope.Entries = response.data[0].Results;
    });


$scope.getZZ6533 = function ( oid ){
    $scope.Oid = oid;

    $http({
        method: 'GET',
        url: apiurl + "getZZ6533?Oid="+$scope.Oid,
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        responseType:'arraybuffer'
    }).success(function(response){
        var file = new Blob( [response], {type: 'application/pdf'} );
        var fileURL = URL.createObjectURL(file);
        window.open(fileURL);
    });
  };

  $scope.getHH1213 = function ( oid ){
    $scope.Oid = oid;

    $http({
        method: 'GET',
        url: apiurl + "getHH1213?Oid="+$scope.Oid,
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        responseType:'arraybuffer'
    }).success(function(response){
        var file = new Blob( [response], {type: 'application/pdf'} );
        var fileURL = URL.createObjectURL(file);
        window.open(fileURL);
    });

};