A very common use of filters is to order or filter out dynamic elements built using the
orderBy filters to generate a table that can be sorted by column and filtered by a string from an
Listing 5.9 implements a controller that defines the
$scope.planes array to use as input data in the scope. Since you do not want to alter the actual model data when sorting and filtering, line 12 adds the
$scope.filteredPlanes property to store the filtered array.
Notice that line 13 sets a
$scope.reverse value to keep track of the sort direction. Then line 14 sets a
$scope.column value to keep track of ...