我想過濾表中的數據,以便它只顯示我在某個日期輸入的項目,但我似乎無法得到此工作。當我選擇新的日期時,我可以看到模型正在更新,但表中的數據不會更改。由日期不正確的JS過濾器不起作用
HTML:
<tr ng-repeat='file in files | filter: date '>
日期選擇器HTML:
<label>From:</label>
<p class="input-group" style="width:200px">
<input type="text" class="form-control" uib-datepicker-popup = "{{format}}" ng-model="date" is-open="status.opened"
min-date="minDate" max-date="maxDate" datepicker-options="dateOptions" date-disabled="disabled(date, mode)"
ng-required="true" close-text="Close"/>
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
控制器:
(function()
{
'use strict';
angular.module('aml-tech-dashboard.successful-emails').controller('datepickerController', function ($scope) {
$scope.date = '';
$scope.status = {
opened: false
};
$scope.format = "yyyy-MM-dd"
$scope.minDate = new Date();
$scope.dateOptions = {
//formatYear: 'yy',
startingDay: 1
};
$scope.open = function ($event) {
$scope.status.opened = true;
};
$scope.date = new Date();
});
})();
喜,它不工作日期選擇器? – terpinmd
即使我們正在談論小時或分鐘,您的列表項目的日期必須與所選日期不同 –
如果日期不同,當我選擇日期時,是否所有東西都不應該從表格中消失? – Andreea