0

html

<!DOCTYPE html>
<html ng-app=EmployeeApp>

  <head>
    <script data-require="angular.js@1.2.0-rc3" data-semver="1.2.0-rc3" src="http://code.angularjs.org/1.2.0-rc.3/angular.min.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
    </head>

  <body ng-controller="empCtrl">      
   <table>
    <tr>
        <td align="right">Search :</td>
        <td><input ng-model="query[queryBy]" /></td>
    </tr>           
    <tr>
        <td align="right">Search By :</td>
        <td>
            <select ng-model="queryBy">
                <option value="$"></option>
                <option value="name">NAME</option>
                <option value="company">COMPANY</option>
                <option value="Number">Number of Employees</option>
            </select>   
        </td>
    </tr>
</table>
<hr>
<div>
    <table>
        <tr>
            <th>Employee Name</th>
            <th>Company Name</th>
            <th>Number of Employees</th>
        </tr>
        <tr ng-repeat="emp in employees | filter:query">
            <td>{{emp.name}}</td>
            <td>{{emp.company}}</td>
            <td>{{emp.Number}}</td>
        </tr>
    </table>
 </div>
 </body>

</html>

JS code

var employeeApp = angular.module("EmployeeApp",[]);
  employeeApp.controller("empCtrl",function($scope){
  $scope.query = {}
  $scope.queryBy = '$'
  $scope.employees = [
  {
    "name" : "Mahesh Pachangane",
    "company" : "Syntel India Pvt. Ltd",
    "Number" : 10
  },
  {
    "name" : "Brijesh Shah",
    "company" : "Britanica Software Ltd.",
    "Number" : 15
  },
   {
    "name" : "Brijh Shah",
    "company" : "hi Software Ltd.",
    "Number" : 11
  }
  ];
  $scope.orderProp="name";                
 });

using these two codes I can filter data that are equal to the specific attribute value in table.How can I exact data that less than, greater than ,not equal to the specific value? is there any plugin that I can use for that?

0 Answers0