+ ng-repeat="pokemon in pokemons | filter: filterText | orderBy:propertyName:reverse | limitTo: numberOfItemsToDisplay">
![]()
diff --git a/www/templates/pokemonliste/html/pokemon-setting.html b/www/templates/pokemonliste/html/pokemon-setting.html
index b888d82..2c6003a 100644
--- a/www/templates/pokemonliste/html/pokemon-setting.html
+++ b/www/templates/pokemonliste/html/pokemon-setting.html
@@ -17,30 +17,22 @@
-
- Sortierung aufsteigend
+ Sortierung aufsteigend
-
-
- Sortierung absteigend
+ Sortierung absteigend
-
-
- Nach PokedexID sortieren
+ Nach PokedexID sortieren
-
- Nach Namen sortieren
+ Nach Namen sortieren
-
- Nach Typ sortieren
+ Nach Typ sortieren
-
- Liste aktualisieren
+ Liste aktualisieren
diff --git a/www/templates/pokemonliste/js/controllers.js b/www/templates/pokemonliste/js/controllers.js
index 89a7ace..1935f5a 100644
--- a/www/templates/pokemonliste/js/controllers.js
+++ b/www/templates/pokemonliste/js/controllers.js
@@ -13,7 +13,7 @@
// http://ngcordova.com/docs/plugins/sqlite/
//
// Controller of Pokemon List Page.
-appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, $ionicHistory,pokedexDB, dataShare) {
+appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, $ionicHistory, pokedexDB, dataShare) {
// initialForm is the first activity in the controller.
// It will initial all variable data and let the function works when page load.
@@ -50,8 +50,14 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
jQuery('#pokemon-list-loading-progress').hide();
jQuery('#pokemon-list-content').fadeIn();
$scope.isLoading = false;
+
+ //Standard orderby filter
+ $scope.propertyName = 'pokemonname';
+ $scope.reverse = true;
+
}, 1000);// End loading progress.
+
$scope.admob_key = window.globalVariable.adMob;
// Calling to initial AdMob.
@@ -112,15 +118,15 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
if (data.command=='sortby'){
if (data.direction=='pokemonname'){
- $scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokemonname');
+ $scope.propertyName = 'pokemonname';
}
if (data.direction=='pokedexid'){
- $scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokedexid');
+ $scope.propertyName = 'pokedexid';
}
if (data.direction=='pokemontyp'){
- $scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokemontypa');
+ $scope.propertyName = 'pokemontypa';
}
}
@@ -128,7 +134,10 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
if (data.command=='orderby'){
if (data.direction=='asc'){
-
+ $scope.reverse = false;
+ }
+ else{
+ $scope.reverse = true;
}
}