I have thing working correctly in angular
Any: <input ng-model="search.$">
Student Name only <input ng-model="search.number">
student Region only <input ng-model="search.region">
and this
<li ng:repeat="students in student | filter:search" >
But i want to make those three search box into one search box and select box like this
Any: <input ng-model="search.$">
<select>
<option value="number">Student Number</option>
<option value="region">Student Region</option>
</select>
Also i would like to perform search when user click on search button
How can i do that
You could set your search value when user hits the button.
live sample: http://plnkr.co/edit/jTRmBH.
template:
<label>
Search Value: <input ng-model="filter">*emphasized text*
</label><br>
<label>
Search Key:
<select ng-model="key">
<option value="$">Any</option>
<option value="number">Student Number</option>
<option value="region">Student Region</option>
</select>
</label>
<button ng-click="setfilter()">search</button>
javascript:
$scope.setfilter = function() {
$scope.search = {};
$scope.search[ $scope.key ] = $scope.filter;
console.log( $scope.search );
};