0
Talk people, I have the following problem, I have a list of names:
$scope.names=["Max", "Tom", "Ralf", "Jerry", "Snow", "Carl"];
I made a normal filter for input search
<ul>
<li ng-repeat="name in names | filter: search">{{name}}</li>
</ul>
</div>
<div>
<input type="search" ng-model="search">
</div>
However I want to create a custom filter to show only the names related to the first letter typed in the input search, in case, type the letter "R" and the result is only "Ralf" instead of searching for the "R" in all letters, which results in "Ralf" and "Jerry".
I thought to use an angular.foreach to go through the names but I could not get the result I wanted, if it helps, follow the codepen to facilitate:
Please post the code of your filter so far, and what the result is getting with it.
– Vinícius Gobbo A. de Oliveira