updateURL is not implemented


I saw in the current latest (1.0.0.rc-6.1), the replaceURL nor updateURL functions are not finished. I was wondering if anyone has alternatives that work with the current router to be able to replace the browser’s history (path)?

See https://github.com/emberjs/ember.js/pull/2887


Not finished? What do you mean?




So that code is from the router.js microlib. Those hookpoints are overridden by Ember and delegated to hash location or history location.


Ah… That makes sense. So in my app, I am trying to replace the location without triggering a route response. Here’s how I ended up doing it:

var queryString = App.get('criteria').serialize();
window.history.pushState({ path: '#/' + queryString }, null, '#/' + queryString);

I imagine this is probably the wrong way to do it, but I couldn’t figure out any other way. Is this something that Ember currently supports or does this fall into the category of querystring support that will be added?


If you’re trying to get your app to function with querystrings, then yes, that will probably have to wait (or you can try some hacks; just not sure how sustainable that’ll be).

If you’re just trying to get replaceState to work with the history API, you can check this out: http://emberjs.com/guides/routing/specifying-the-location-api/