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.
<div ng-app="myApp" ng-controller="ctrl">
<div ng-repeat="image in images">{{image}}</div>
<button ng-click="order('0')">By orgName</button>
<button ng-click="order('1')">By sortOrder</button>
</div>
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