离子滑块在使用ng-repeat动态更新离子滑块离子滑动盒时不起作用

时间:2016-02-07 09:39:40

标签: javascript angularjs ionic-framework

我现在使用离子滑块在特定日期的幻灯片中显示某些数据,此时更新日期需要更改用户滑块。但它没有正常工作

滑块代码:

<ion-slide-box on-slide-changed="slideHasChanged($index)" class="{{showList}}" does-continue="true" ng-if="todos.today.length">
<ion-slide ng-repeat="todo in todos.today track by $index" >
<div class="list card" >
<ion-checkbox ng-model="todo.did">{{todo.name}}</ion-checkbox>
<label class="item item-input">
  <input type="text" placeholder="Name" ng-model="todo.name">
</label>
<label class="item item-input">
<input type="text" placeholder="Description" ng-model="todo.desc">
</label>
<label class="item item-input">
<input type="number" placeholder="Amount" ng-model="todo.amount">
 </label>
 <br>
<button type="button" class="btn btn-primary btn-xs" ng-click="saveThis(todo)">save</button>
</div>
</ion-slide>
</ion-slide-box>

我的Datepicker

    <ionic-datepicker date="currentDate" min="minDate" max="maxDate" callback="datePickerCallback">
  <button class="button   button-block" style="font-size:26px; padding:10px;margin-top:0px; background-color:#009688;color:white"> {{ currentDate.getDate()}} {{month}}</button>
</ionic-datepicker>

控制器:

$scope.datePickerCallback = function (val) {
    if (!val) {
        console.log('Date not selected');
    } else {

        $scope.sliderChange();
        AppDate.dt=val;
        dao.date=val;
    var tmp={fr:1,did:true,name:'newItm',desc:'',amount:20,date:''};
        $scope.todos.today.push(tmp);
        $scope.month=month_name(dao.date.getMonth(),1);
        $ionicSlideBoxDelegate.update();
        console.log("Updated");
    }
}

离子滑块 enter image description here

更改日期后 enter image description here

0 个答案:

没有答案