@Aceconhielo wrote:
Hello,
Im trying to create a controller that clear the cache of navigation in the app for make a Logout button.
My idea is cleaning the Session ID when I tap the Logout Button so I can go the Welcome View with the app "closed".
Im trying to use $ionicHistory for this:
.controller('LogoutCtrl', ['$scope', '$state', '$ionicHistory', function($scope,$state,$ionicHistory) { $scope.logout = function(){ $ionicHistory.clearCache().then(function() { //now you can clear history or goto another state if you need $ionicHistory.clearHistory(); $ionicHistory.nextViewOptions({ disableBack: true, historyRoot: true }); $state.go('welcome'); }) }; }])
But when I tap the button, It does nothing.
`<button class="button button-block button-dark" ng-click="logout()" >Logout</button>`
Any ideas what is the problem?
Posts: 3
Participants: 2