Filtrar array por multiples campos
Aquí vemos como podemos filtrar el array con campos multiples.
by Fabian Allel
HTML
<div ng-app="myApp">
<div ng-controller="Padre1Controller">
<input type="text" ng-model="textoFiltro"/>
<div ng-repeat="var in variable | filter:{'grade': textoFiltro, 'title': textoFiltro}">
{{var.title}}
</div>
</div>
</div>
JavaScript
(function() {
var myApp=angular.module('myApp', []);
myApp.controller('Padre1Controller', function($scope){
$scope.variable=[
{title:'English',grade:'A'},
{title:'Maths',grade:'A'},
{title:'Science',grade:'B'},
{title:'Geography',grade:'C'}
];
});
})();