I'm currently working on one of my first angularJS projects and I'm stuck. So what am I trying to do?
I'm trying to filter my ng-repeat with a selected date from an input type = date this is my view:
<div class="form-group col-md-3">
<label for="date">Tender Date</label>
<input type="date" id="date" ng- model="searchDate.TenderDate"class="form-control">
</div>
<div >
<table class="table table-bordered">
<thead>
<th>Tender ID</th>
<th>Business unit</th>
<th>Therapy Unit</th>
<th>Tender Date</th>
</thead>
<tbody ng-repeat="tender in tenders | filter:searchDate">
<td>{{tender.TenderID}}</td>
<td>{{tender.businessUnit}}</td>
<td>{{tender.therapyUnit}}</td>
<td>{{tender.TenderDate}}</td>
</tbody>
</table>
</div>
This is my json file:
{
"Tenders":[{
"businessUnit": "GN_RE S-RETAIL",
"therapyUnit" : "Hospital Product ",
"TenderID" : "BE_13_N2.1_001",
"TenderDate" : "2016-03-17"
},
{
"businessUnit": "GN_RE S-RETAIL",
"therapyUnit" : "Hospital Product ",
"TenderID" : "BE_13_N2.1_01",
"TenderDate" : "2016-03-18"
}
]
}
I have nothing in my controller. I am able to link a searchfield to a to a particular field in my array but the problem is the date type isn't working. I hope you guys can help me!