function MyCtrl($scope, $filter)
{
$scope.items = [
{id:71610067, name:'John'},
{id:2, name:'Steve'},
{id:3, name:'Joey'},
{id:4, name:'Mary'},
{id:5, name:'Marylin'}];
$scope.items2 = $scope.items;
$scope.$watch('search', function(val)
{
$scope.items = $filter('filter')($scope.items2, val);
});
};
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="data.js" ></script>
<body>
<div ng-app>
<div ng-controller="MyCtrl">
<input type="text" ng-model="search">
<table>
<tbody>
<tr ng-repeat="item in items">
<td>{{item.id}}</td>
<td>{{item.name}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The list will only consists of names matching the filter.</p>
</body>
</html>
Alguien me ayuda a saber porque mi codigo no funciona?
angular.module
y registrar elcontroller
en el mismo. Te recomiendo que leas la guia para desarrolladores deAngular