Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Changing pages two times

$
0
0

@clembo590 wrote:

Hello.

I have 3 pages (views).

from page1 I can go to page2.

Once I am on page2, I would like that when a user click on a given button
- it goes back to page1 without the user noticing.
- go to page3

in order to do that, I wrote in the "button listener"

function actionOnButtonClick(){
$ionicHistory.goBack(); //go back to page1 : appears to not be taken into account
$state.go('page3'); //then go to page3
}

This way, if the user is on page3 and click the "back button" (which only calls "$ionicHistory.goBack():wink: he should go back to page1.

My problem is that it's not the case. it brings him back to page2 exacty as if I had written:
function actionOnButtonClick(){
//$ionicHistory.goBack();
$state.go('page3'); //then go to page3
}

I used $stateChangeStart and $stateChangeSuccess to see what is going on and it appears that
when the $ionicHistory.goBack(); is called stateChangeStart is fired but stateChangeSuccess is not.

Can anyone help me do what I want: "go back to the previous page without the user noticing anything and then go to another page in the same function".

thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>