diff --git a/www/js/app.js b/www/js/app.js index 6bdff46..2674d6a 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -343,7 +343,8 @@ angular.module('starter', ['ionic','ngIOS9UIWebViewPatch','starter.controllers', url: "/pokemonlist", cache: true, params:{ - isAnimated:(ionic.Platform.isAndroid()==false) + isAnimated:(ionic.Platform.isAndroid()==false), + controllersettings: null }, views: { 'menuContent': { diff --git a/www/templates/menu/js/controllers.js b/www/templates/menu/js/controllers.js index 21e7df7..83b9c7a 100644 --- a/www/templates/menu/js/controllers.js +++ b/www/templates/menu/js/controllers.js @@ -116,10 +116,10 @@ appControllers.controller('menuCtrl', function ($scope, $timeout, $mdUtil, $mdSi targetEvent: null, locals: { displayOption: { - title: "Confirmation", - content: "Do you want to close the application?", - ok: "Confirm", - cancel: "Cancel" + title: "App beenden?", + content: "Möchten Sie PokedexHelper wirklich beenden?", + ok: "Ja", + cancel: "Nein" } } }).then(function () { diff --git a/www/templates/pokemonliste/html/pokemon-detail.html b/www/templates/pokemonliste/html/pokemon-detail.html index 9751d91..4678f93 100644 --- a/www/templates/pokemonliste/html/pokemon-detail.html +++ b/www/templates/pokemonliste/html/pokemon-detail.html @@ -346,7 +346,7 @@
@@ -366,13 +366,21 @@ -Clear All Data
Refresh Data
diff --git a/www/templates/pokemonliste/js/controllers.js b/www/templates/pokemonliste/js/controllers.js index 52d3e3f..85c004d 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, pokedexDB) { +appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, $ionicHistory,pokedexDB) { // initialForm is the first activity in the controller. // It will initial all variable data and let the function works when page load. @@ -94,6 +94,17 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion $scope.initialForm(); }); + + $scope.$on('$ionicView.enter', function(viewInfo, state){ + console.log('ENTERED'); + $scope.controllersettings = $stateParams.controllersettings; + if ($scope.controllersettings.refresh=='1'){ + console.log("refreshed"); + //$scope.initialForm(); + } + console.debug($scope.controllersettings); + }); + });// End of Pokemon List Page Controller. // Controller of pokemon Detail Page. @@ -289,8 +300,6 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc // For confirm button to remove all data. try { // Remove all data by calling pokedexDB.removeAll() service. - pokedexDB.removeAll(); - $scope.pokemonsCount = []; //Showing toast for remove data is success. $mdToast.show({ controller: 'toastController', @@ -324,6 +333,10 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc };// End clear all data from sqlite + $scope.refreshData=function(){ + + }; + // navigateTo is for navigate to other page // by using targetPage to be the destination state. // Parameter : @@ -340,7 +353,8 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc $ionicViewSwitcher.nextDirection('back'); $state.go(stateName, { - isAnimated: objectData, + isAnimated: objectData.isAnimated, + controllersettings: objectData.controllersettings, }); } }; // End of navigateTo. diff --git a/www/templates/pokemonliste/js/services.js b/www/templates/pokemonliste/js/services.js index da5ad80..4718ea8 100644 --- a/www/templates/pokemonliste/js/services.js +++ b/www/templates/pokemonliste/js/services.js @@ -49,6 +49,10 @@ appServices.factory('pokedexDB', function ($cordovaSQLite) return { // Select all data from sqlite + refresh: function () + { + return this.all(); + }, all: function () { pokemonList = [];