AngularJS Tutorial - Filter as you type








The following code shows how to do filtering as you type.

Example


<!DOCTYPE html>
<html  ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from  ww  w  . j  a  v a2  s .c om-->
<body>
  <body ng-app>
    <input ng-model="search"/>
    <div class="container" ng-controller="ListCtrl">
        <ul>
            <li ng-repeat="fw in frameworks | filter:search">
                {{fw.name}} ({{fw.language}})
            </li>
        </ul>
    </div>
</body>
<script type='text/javascript'>
function ListCtrl ($scope) {
    $scope.frameworks = [
        {name: 'Django', language: 'Python'},
        {name: 'AngularJS', language: 'Javascritp'}
    ];
}
</script>
</body>
</html>

The code above is rendered as follows: