I am facing an issue with my Angular filter when inputting text for a specific list.
initialViewModel.users = [
{user: 'Nithin',phone: 'Azus', price: 13000},
{user: 'Saritha',phone: 'MotoG1',price: 12000},
{user: 'Renjith',phone: 'MotoG2',price: 14000},
{user: 'Felix',phone: 'Nexus',price: 21000}];
The filter is giving incorrect results for the text values a,g,m,n,o,s,u,z
.
You can view a sample fiddle here.
<ul>
<li ng-repeat="user in Model.users | filter: Model.name | orderBy:'price'">{{user.user + ' bought phone worth ' + user.price}}</li>
</ul>
For example, when filtering with 'a', it should only return the record where the name is Saritha. However, it is showing two records instead of one.