I'm developing hotel booking site. I have completed development on load data from WebAPI. I want to add filters after page load.
Script
function getAll() {
var sub = {
Des: $scope.Des,
DepartureDate: $scope.DepartureDate,
ReturnDate: $scope.ReturnDate,
Rooms: $scope.Rooms,
};
var getAll = APIService.hotelavailability(sub);
getAll.then(function (d) {
console.log("Succss");
$scope.respData = d.data.hotels;
}, function (error) {
console.log('Oops! Something went wrong.');
}
CHTML Code
<div class="hotel_filter">
<input ng-model="hotelName" class="form-control" placeholder="Search hotel" type="text" id="searchbox">
</div>
<div ng-repeat="hotel in respData.hotels" class="clearfix">
<h2>{{hotel.name}}</h2>
</div>
How can i filter hotel data after page load from input box(searchbox)?.