Today when writing back with Ionic.js ( switch to the previous view in the history stack), I do not know why the goBack () function is always ineffective, the code is as follows:
. Controller ("Teachcontroller", Function ($scope, $state, $ionicPopover, $ionicHistory) {$state. Go ("projectlist"); Scope.go_back = function () {//$ionicHistory. Forwardview (); $ionicHistory. GoBack (); Alert (111);})
There is really no way, the change of a method, although the effect of implementation, but do not know what will be the problem!
The code is as follows:
. Controller ("Teachcontroller", Function ($scope, $state, $ionicHistory, $window) {//Switch to State: Projectlist$state.go (" Projectlist "); $scope. $window = $window; $scope. go_back = function () {//$ionicHistory. GoBack (); $window. History.back ();//alert (111);};});
AngularJS Back button