如何使用ionic1中的单选按钮过滤列表

时间:2018-05-28 07:36:12

标签: javascript html angularjs

在我的情况下有3个单选按钮..我想在我点击第一个单选按钮PRESENT-ON TIME时过滤数据。它只显示正在当前的学生,反之亦然。 API响应 late_status = 0准时 late_status = 1表示迟到

我的HTML文件看起来像这样

`<input type="radio" name="process" ng-value="0" id="design" ng-click='present1()' ng-model="data.late_status"/><label class="choice" for="design" > Present-On Time</label><br />

<input type="radio" name="process" ng-value="1" id="late" ng-click='late1()' ng-model="data.late_status" /><label class="choice" for="late"> Present-Late</label><br />

<div ng-hide="myVar"  class="col col-20" ng-if="data.late_status == 0"><i><b>On Time</b></i>
               <!-- If block(ON TIME) -->
               </div>
              <div ng-hide="myVar"  class="col col-20" ng-if="data.late_status != 0"><i><b>Late</b></i>                         
                <!-- Your Else Block(LATE) -->
</div>`

controller.js文件

  $scope.late1 = function () {



        $ionicLoading.show({

                         template: '<ion-spinner></ion-spinner><p>Loading...</p>'

                           });

        $scope.data={late_status:'1'};


            var link =
            var datasend = $.param({
                request_code: 'get'[enter image description here][1]
                start_time: '08:00:00',
                end_time: '10:00:00',
                machine_id: '101',

              //date:"17-02-2018"  
               date: today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear()
                         });

帮助..由于我是新用户,我无法上传图片文件。

0 个答案:

没有答案