I have got following html code:
<p><input type="text" ng-model="test"></p>
<ul>
<li ng-repeat="x in names | filter:test">
{{ x }}
</li>
</ul>
and corresponding JS is :
<script>
angular.module('myApp', []).controller('namesCtrl', function($scope) {
$scope.names = [
'Jabi',
'Cabi',
'Margareth',
'Hege',
'Joe',
'Gustav',
'Birgit',
'Mary',
'Kai'
];
});
</script>
the problem is when i type "bi" the filter returns me all the names containing "bi" however i want that filter should return only the names starting with "bi"(or watever is written in input textbox)