0
votes

I have an ember.js router based application with an interesting quirk. Since the router documentation is rather sparse, I'm not sure if this is a feature or a bug or an un-intended consequence of some of my code elsewhere.

When I reload the page containing the app in my browser, the App jumps to the route of where I last was. I have the routes serialized as a hash. So an example would be I'm on app.html#/users/1/details and I delete the hash and add a random query variable app.html?reload=randomnumber and load the page. As soon as ember loads, it is adding the #/users/1/details back to that address.

Is this a feature/consequence of ember, or is it some junk that I wrote. I haven't found anything that I wrote that could be causing this so far.

If it is an ember feature, is there a way to disable it?

1

1 Answers

0
votes

What are you calling "reload", exactly?

Ember cannot keep any state in your browser when route is serialized using a hash. It has nothing to see with Ember: when reloading the page, the whole state is lost, and reset according to requested url returned content initializations.

Nevertheless, when a hash is present, it is used by Ember to reset the router's state.

So what I would suspect is you are still reloading the URL .../app.html#/users/1/details.

Did you take a look at your Network history, in the developer tools (or equivalent)?

The first item should be a GET request, and it will indicate the effective requested URL and the hash if any.