Filter as you type

Description

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  w w w  .ja va  2s. c  o  m-->
<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>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities