-
Book Overview & Buying
-
Table Of Contents
AngularJS Web application development Cookbook
By :
AngularJS search filters work exceedingly well out of the box, but you will quickly develop the desire to introduce some customization of how the filter actually relates the search object to the enumerable collection. This collection is frequently composed of complex data objects; a simple string comparison will not suffice, especially when you want to modify the rules by which matches are governed.
Searching against data objects is simply a matter of building the search object in the same mould as the enumerable collection objects.
Suppose, for example, your controller looks as follows:
(app.js)
angular.module('myApp', [])
.controller('Ctrl', function($scope) {
$scope.users = [
{
firstName: 'John',
lastName: 'Stockton'
},
{
firstName: 'Michael',
lastName: 'Jordan'
}
];
});When searching against this collection, in the case where the search filter is passed a string primitive, it will perform...
Change the font size
Change margin width
Change background colour