OK this is strange, I seem to be getting something similar to this…
But I’m not using the rootScope (as such) in the actual page controllers (just the AppCtrl), so it doesn’t do what the suggested codepen does:
Instead I’ve stripped all the map loading on the map page and what it does is only fire loaded once on home, but on every entry of mapCtrl???
http://embed.plnkr.co/rjQs2S/preview
The only notable difference I can see between the two is one has a side menu and the other doesn’t. Is this a bug with ionic page events and the state provider?
EDIT: Seriously what the heck???
Console output:
Loading: home
Entering: home
Loading: map
Entering: map
Loading: test
Entering: test
Entering: home
Entering: map
Entering: test
Entering: map
Loading: test <-- loads test again
Entering: test
Entering: home
Entering: map
Entering: test
Entering: map
Entering: home
Loading: map <-- loads map again
Entering: map
Loading: test <-- loads test again
Entering: test
Entering: map
Entering: home
Loading: test<-- loads test again
Entering: test
I’ve also released the example on the codepen doesn’t “really” work, here is my version of it with clearer console logging:
Page1Ctrl loaded
Page1Ctrl entered
Page2Ctrl loaded
Page2Ctrl entered
Page3Ctrl loaded
Page3Ctrl entered
Page1Ctrl entered
Page2Ctrl entered
Page3Ctrl entered
Page1Ctrl entered
Page3Ctrl entered
Page2Ctrl entered
Page1Ctrl loaded <-- loaded again
Page1Ctrl entered
Page3Ctrl loaded <-- loaded again
Page3Ctrl entered
Page2Ctrl loaded <-- loaded again
Page2Ctrl entered
Page1Ctrl loaded <-- loaded again
Page1Ctrl entered
Page2Ctrl loaded <-- loaded again
Page2Ctrl entered
Page3Ctrl loaded <-- loaded again
Page3Ctrl entered
Page1Ctrl entered
Page2Ctrl entered
AAAAaaaaAAAh… I just noticed, the thing that seems to be true of the plunker and codepen code base is it seems like returning to the “Home” or “Page1” seems to reset the app almost and it starts reloading pages??? Is that intended functionality??? It can’t be as it doesn’t seem to do it “all” the time.
I can even duplicate the bug(?) above. go to the codepen url, go forward through page 2,3,1,2,3,1,2,3,1 then back 3,2,1 <- at this point page 1 will reload