0

I'm building an Ember application that takes path to other document as a route dynamic segment parameter. The document is further displayed in iframe inside my app. I'm using a locationType: hash option in environment and a wildcard route as in this answer: https://stackoverflow.com/a/17053050/1367361

The route is defined as:

this.route('display', {path: '*document_path'});

After entering URL like this:

http://localhost/#/display/some/document.html

The route:display invokes model method with parameter:

{ document_path: "some/document.html" }

I want to be able to pass # sign in the document_path, but entering URL like this:

http://localhost/#/display/some/document.html#some-paragraph

cuts everything after the # sign and passes:

{ document_path: "some/document.html" }

into the model.

I know that it works if I change locationType to history. But at the moment for some reason I want to use hash locationType.

It is possible to pass the # as a dynamic segment when using locationType: hash?

Community
  • 1
  • 1
kliput
  • 1
  • 1
  • You could encode it, but I don't think that's what you're after? – locks Feb 09 '17 at 17:07
  • Yes, I can encode/decode it to other char, but I'm curious if using raw ``#`` is possible and my goal is to see it in URL. Anyway, if there is no other way, I will do that. – kliput Feb 09 '17 at 18:30

0 Answers0