Having issues with getting this filter to work.
$scope.imgCollection.then(function (images) {
$scope.images = images.thisGal_images;
if ($scope.images[0
I created a demo for you and hopefully you can compare the code and figure out the issue.
I guess you might forget to inject $filter
module. Please take a look a the demo.
{{image}}
var app = angular.module('myApp', []);
function ctrl($scope, $filter) {
$scope.images = [{
orgName: 'B',
sortOrder: 111
}, {
orgName: 'A',
sortOrder: 12
}, {
orgName: 'D',
sortOrder: 13
}, {
orgName: 'C',
sortOrder: 14
}];
$scope.order = function (order) {
if (order == '0') {
$scope.images = $filter('orderBy')($scope.images, 'orgName');
} else {
$scope.images = $filter('orderBy')($scope.images, 'sortOrder');
}
}
}
Working Demo