Auto-reload returns to first page on serve


#1

Hi there,

Sorry if this is a dumb question or I’m missing out something very simple. Was previously working (a lot) with Ionic 1.x

The way UI-router worked in Angular 1.x with Ionic, is that you had an url.

So localhost/#/home for example. And if you did changes on a page that was #/users -> you get auto reload back to /user

Now, in Ionic 2, there are no urls, meaning that if you make a change on a /user page, you get returned to home page again. And if that page is login you have to login again for example (unless you hacky). You see how this is a problem? A lot of time getting wasted?

Is there a way to use normal ‘routing with auto-reload’ in Ionic 2? Am I missing out on something very simple?

Best!
Marko


#2

Well so far I’ve learned about deep linking for PWA

And more topics about that…

But seriously, do I really have to do all this just so that the reload on ionic serve returns me to the right page?


#3

Read the Ionic changelog. URLs are changing. The DeepLinking docs will probably need to change soon. Don’t sink a bunch of time into this until you understand exactly what is going to break.


#4

Deep Linking feels a bit too much anyway for a simple thing like this.

I’m just trying to find out how do I reload a Ionic tab and get returned to it instead of being returned on beginning?


#5

It might not be possible without storing information in a provider you create. Ionic isn’t designed for browser reload. To accommodate that, I had to remove all use of navParams from my code, for example. And the tabs navigation assumes very standard use of the app by a user of a handheld device. There are lots of edge cases where tabs routing is weird. I don’t use tabs for this reason, so maybe a poster who likes tabs more will have a better answer for you. But as a general comment, Ionic is fragile when dealing with browser page refresh.


#6

I figured out there is this example

All though it forces to kinda change structure of existing tabs starter.

So, does testing on emulator/device works normally for you when you auto-reload a change? (how does that behave?)

Thanks for the replies btw

Edit. It doesnt even compile. Bunch of dependency issues there.