I have a controller:
function ItemsCrtl($scope) {
$scope.items = [
{id: 0, name: "PC"},
{id: 2, name: "GEladeira"},
{id: 3, name: "Fogao"},
{id: 4, name: "cama"},
{id: 5, name: "privada"},
{id: 6, name: "sofá"}
]
}
And in my html:
<div ng-controller="ItemsCrtl">
<input type="text" ng-model="items.name">
<ul>
<li ng-repeat="item in items">
{{item.id}} - {{item.name}}
</li>
</ul>
</div>
But ng-model does not work, it does not filter the list by the name of the item. How to do this when it is a list of objects.