Menu settings testing

This commit is contained in:
Carsten Hilmer 2016-09-14 01:46:10 +02:00
parent fa55d4fee9
commit 6b627d50f9
7 changed files with 41 additions and 14 deletions

View File

@ -343,7 +343,8 @@ angular.module('starter', ['ionic','ngIOS9UIWebViewPatch','starter.controllers',
url: "/pokemonlist", url: "/pokemonlist",
cache: true, cache: true,
params:{ params:{
isAnimated:(ionic.Platform.isAndroid()==false) isAnimated:(ionic.Platform.isAndroid()==false),
controllersettings: null
}, },
views: { views: {
'menuContent': { 'menuContent': {

View File

@ -116,10 +116,10 @@ appControllers.controller('menuCtrl', function ($scope, $timeout, $mdUtil, $mdSi
targetEvent: null, targetEvent: null,
locals: { locals: {
displayOption: { displayOption: {
title: "Confirmation", title: "App beenden?",
content: "Do you want to close the application?", content: "Möchten Sie PokedexHelper wirklich beenden?",
ok: "Confirm", ok: "Ja",
cancel: "Cancel" cancel: "Nein"
} }
} }
}).then(function () { }).then(function () {

View File

@ -346,7 +346,7 @@
<div class="footer-fab-bar"> <div class="footer-fab-bar">
<a class="md-button md-accent md-fab fab-footer" ng-click="showListBottomSheet($event,contractForm)" <a class="md-button md-accent md-fab fab-footer" ng-click="showListBottomSheet($event,contractForm)"
aria-label="Contract Form Actions"> aria-label="Contract Form Actions">
<i class="ion-android-star"></i> <i class="ion-navicon-round"></i>
</a> </a>
</div> </div>
<!--end Pokemon detail section--> <!--end Pokemon detail section-->
@ -366,13 +366,21 @@
</a> </a>
</md-list-item> </md-list-item>
<md-list-item ng-show="actionDelete"> <md-list-item>
<a class="md-default-theme md-bottom-sheet-list-item" <a class="md-default-theme md-bottom-sheet-list-item"
ng-click="deleteContract(contract,$event)"> ng-click="deleteContract(contract,$event)">
<i class="ion-android-delete"></i> <i class="ion-android-delete"></i>
<span>Als Lesezeichen speichern</span> <span>Als Lesezeichen speichern</span>
</a> </a>
</md-list-item> </md-list-item>
<md-list-item>
<a class="md-default-theme md-bottom-sheet-list-item"
ng-click="deleteContract(contract,$event)">
<i class="ion-android-delete"></i>
<span>Pokemon Bild setzen</span>
</a>
</md-list-item>
<!--end md bottom sheet list item--> <!--end md bottom sheet list item-->
</md-list> </md-list>
</md-bottom-sheet> </md-bottom-sheet>

View File

@ -26,7 +26,7 @@
</md-toolbar><!--end toolbar section--> </md-toolbar><!--end toolbar section-->
<!--pokemon list section--> <!--pokemon list section-->
<ion-content id="pokemon-list-content" class="fade-in"> <ion-content id="pokemon-list-content">
<!--list section--> <!--list section-->
<md-list> <md-list>
<!--Below code it will disable animation to better performance--> <!--Below code it will disable animation to better performance-->

View File

@ -5,7 +5,7 @@
<!--State name : app.contractsetting--> <!--State name : app.contractsetting-->
<!--URL : #app/contractsetting--> <!--URL : #app/contractsetting-->
<ion-view title="SQLite Setting"> <ion-view title="PokedexHelper - Einstellungen">
<!--left button on navigation bar--> <!--left button on navigation bar-->
<ion-nav-buttons side="left"> <ion-nav-buttons side="left">
<a ng-click="$ionicGoBack()" class="button back-button buttons button-clear header-item nav-back-btn"> <a ng-click="$ionicGoBack()" class="button back-button buttons button-clear header-item nav-back-btn">
@ -35,7 +35,7 @@
<p>&nbsp;Clear All Data</p> <p>&nbsp;Clear All Data</p>
</md-list-item> </md-list-item>
<md-list-item class="md-list-item-default" ng-click="$ionicGoBack()"> <md-list-item class="md-list-item-default" ng-click="navigateTo('app.pokemonlist', {isAnimated:false,controllersettings:{test:'Laola',refresh:'1'}})">
<i class="ion-android-refresh"></i> <i class="ion-android-refresh"></i>
<p>Refresh Data</p> <p>Refresh Data</p>

View File

@ -13,7 +13,7 @@
// http://ngcordova.com/docs/plugins/sqlite/ // http://ngcordova.com/docs/plugins/sqlite/
// //
// Controller of Pokemon List Page. // 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. // initialForm is the first activity in the controller.
// It will initial all variable data and let the function works when page load. // 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.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. });// End of Pokemon List Page Controller.
// Controller of pokemon Detail Page. // Controller of pokemon Detail Page.
@ -289,8 +300,6 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
// For confirm button to remove all data. // For confirm button to remove all data.
try { try {
// Remove all data by calling pokedexDB.removeAll() service. // Remove all data by calling pokedexDB.removeAll() service.
pokedexDB.removeAll();
$scope.pokemonsCount = [];
//Showing toast for remove data is success. //Showing toast for remove data is success.
$mdToast.show({ $mdToast.show({
controller: 'toastController', controller: 'toastController',
@ -324,6 +333,10 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
};// End clear all data from sqlite };// End clear all data from sqlite
$scope.refreshData=function(){
};
// navigateTo is for navigate to other page // navigateTo is for navigate to other page
// by using targetPage to be the destination state. // by using targetPage to be the destination state.
// Parameter : // Parameter :
@ -340,7 +353,8 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
$ionicViewSwitcher.nextDirection('back'); $ionicViewSwitcher.nextDirection('back');
$state.go(stateName, { $state.go(stateName, {
isAnimated: objectData, isAnimated: objectData.isAnimated,
controllersettings: objectData.controllersettings,
}); });
} }
}; // End of navigateTo. }; // End of navigateTo.

View File

@ -49,6 +49,10 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
return { return {
// Select all data from sqlite // Select all data from sqlite
refresh: function ()
{
return this.all();
},
all: function () all: function ()
{ {
pokemonList = []; pokemonList = [];