Page transitions but doesn't load scope nor alert message

Greetings All !

First up, I would like to apologize if anyone is to ask for codepen but I won’t be able to provide one as I am unable to reproduce this issue I’m currently facing.

What happen is that the app is working perfectly fine and as expected on Chrome/Safari but it just goes horribly wrong once I compile it and test it on my iPhone. Here’s a little idea of what’s going on.

I have a page (Create A Group) with a single input field and a submit button where upon submitting the input to the database and receiving a response from the back end (in this case a group id), the page will transition to the group page.

So, in the Create A Group controller (in the submit function to be exact), upon receiving the group id I will trigger the transition of the page to Manage Group using $state.go(‘app.manage-group’, { id: group_id } );

This is then handled over on the Manage Group controller using $stateParams to get the group_id that was passed by the CreateGroupCtrl.

What happens next is that on Manage Page, the back button is visible and this shouldn’t be happening as I’m using $ionicViewService.clearHistory() to prevent this from occurring. Also, I have included ion-nav-buttons elements on both the right and left side of the screen.

I suspect that the app has a Javascript error that prevents the other Javascript from working since it also doesn’t trigger alert messages and doesn’t load any $scope elements.

Note: This method has worked for me in another case but for some reason it didn’t work in this scenario.

I hope to hear from you guys soon!

Thank you and God bless.

Someone amazing please help :frowning:

Can you plug the phone up and view the logs? If it’s a JavaScript error causing it it should show up.

Also, I know you said it only happens when the app is on the device but if you put it in a codepen we can build it into an app.

Thanks brandyshea first of all for responding.

However, I do not quite understand what you meant by plugging in the phone and viewing the logs.

Did you mean using ionic CLI? or something totally different?

What I have tried:
Since my application is built with phonegap, I used the phonegap debug tool. However, all I managed to see is console.log returns that states there was a group_id being returned and passed to the Manage Group screen. The Manage Group controller however does not return any error message whatsoever.

Sorry, I meant plugging the phone up to your computer and using the CLI, yes.

Are you using Phonegap build and their debug tools here: ?

Can you put some logs on the first page and make sure they are printed and then in the manage group controller put another log on enter to see if it is called:

$scope.$on('$ionicView.enter', function() {
    console.log("entering manage controller");

Hi Brandy,

I tried Phonegap build and their debug tools, however there was no message being returned on the console.

However, I have manage to find the issue to my problem and it was because I did not include the file in index.html ( silly mistake all over :expressionless: )

The part I don’t understand was why it didn’t show up in desktop view.

Ah well, at least I got it fixed.

Thanks again brandy! God bless.

1 Like