I'm new to angular.js, but I cannot figure out how to make | filter:xxx work with data generated through $http service.
In the following code, I simply cannot get the filter to work with data generated by $http - it simply does nothing when I type inside input box. However, the filter DOES WORK if I hard code some data inside $scope function.
<div ng-controller="UserCtrl">
<input ng-model="search">
<ul>
<li ng-repeat="user in users| filter:search">
{{user.id}}
{{user.firstname}}
{{user.lastname}}
</li>
</ul>
</div>
<script>
function UserCtrl($scope, $http) {
$http.get('actions.php?action=get_user_list').success(function(data) {
$scope.users = data;
});
}
</script>
array_valuesstrips keys, so array becomes simple 0-based, well, array.