AngularJS根据日期范围过滤JSON数据
我有一个有角度的应用程序,它将显示数据库中的数据,该应用程序将从服务器获取数据作为json.
I have an angular app which will displayed data from database, the app will fetch the data as json from the server.
我有一个复选框和2个 input type = date
的形式,其中一个是开始日期
,另一个是结束日期
,该复选框将启用或禁用那些 input type = date
.
in the form i have a checkbox and 2 input type=date
which is one is start date
and the other is end date
, the checkbox will enable or disable those input type=date
.
因此,我将从数据库中获取所有数据,每当用户启用该复选框时,他们将选择日期,并且该应用程序将根据其选择进行过滤,如果未选中该复选框,则该应用程序将显示所有数据.
So i will fetch all data from database, whenever the user enable the checkbox, they will have select the date and the app will filter based on their selection, if checkbox unchecked then the app will displayed all data.
这就是我填充数据的方式
This is how i populate the data
app.js
$http({
method: 'POST',
url: "api/Enquiry.php",
data: {
matcode:matcode,
location: location,
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
}
}).then(function(response){
$scope.Tablelist = response.data;
console.log(JSON.stringify(response.data));
}, function(response){
console.log("failed");
})
因此,当输入类型日期更改时,我如何根据所选的开始和结束日期