I am trying to set up my Router
to use "hashbang" URLs (#!
).
I tried this, but obviously it doesn't work:
App.Router.map(function() {
this.route("index", { path: "!/" });
this.route("otherState", { path: "!/otherState" });
});
Is this possible to do in Ember?
Teddy Zeenny's answer is mostly correct, and
registerImplementation
seems to be a clean way to implement this. I tried to just edit his answer to make it fully answer the question, but my edit got rejected.Anyway here is the full code to make Ember use hashbang URLs:
Then once you create your app you need to change the router to utilize the "hashbang" location implementation:
Extending
Ember.HashLocation
would be the way to go.For a clean implementation, you can do the following.
Then instruct your App Router to use your custom implementation for location management: