Am neuen in AngularJS, ich schaffe eine Suchvorlage, wählen Sie eine Von Datum und eine Um Datum, ich brauche Ergebnis dieses Bereichs suchen, wenn ich auf die Schaltfläche Suche klicken.Wie nach Datumsbereich in AngularJS
nach der Suchtaste klicken das Ergebnis gefüllt werden muss,
table td,
th {
font-size: 11px;
font-weight: 500;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-bootstrap/0.5pre/assets/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="myApp">
<div class="clearfix" ng-controller="tableDataCtrl">
From : <input type="date" id="fromDate" name="fromDate"><br> To : <input type="date" id="toDate" name="toDate"><br>
<input type="button" id="searchButton" value="Search"><br>
<table class="table">
<thead>
<tr>
<th ng-repeat="th in tableHeader">
{{th}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in tableData">
<td ng-repeat="td in tr">
{{td}}
</td>
</tr>
</tbody>
</table>
</div>
</body>
<script>
var app = angular.module('myApp', []);
app.controller('tableDataCtrl', function tableDataCtrl($scope, $http) {
// $http.get("https://api.myjson.com/bins/uwz13").then(function (response) {
$http.get("https://api.myjson.com/bins/cl913").then(function(response) {
// console.log(response);
$scope.tableData = response.data.data;
$scope.tableHeader = response.data.header;
});
});
</script>
Sie müssen zuerst InvoiceDate in Datum umwandeln und dann mit fromDate und toDate vergleichen – digit