tmeasday / meteor-router

MIT License
366 stars 76 forks source link

URL with anchor #104

Open mattcam opened 11 years ago

mattcam commented 11 years ago

Is it possible to route to link with anchor?

When navigating to /foo#bar the URL gets rewritten as /foo

Have posted example using following router code on http://test_router_anchor.meteor.com/

if (Meteor.isClient) { Meteor.Router.add({ '/': 'front', '/foo': 'foo' });

tmeasday commented 11 years ago

It's possibly not supported by the underlying page.js library. I've never tried it myself.

booshtukka commented 11 years ago

Yes, this doesn't work. :(

booshtukka commented 11 years ago

I've tested this on a meteor app without Router, and the hash is not stripped from the URL. With Router, it is. This is a necessary feature for deep linking. Any chance it will get any attention?

tmeasday commented 11 years ago

Not soon, as I'm working on a different router at the moment.

It's unlikely deep-linking will work out of the box though; the content will usually not be rendered yet when the page first loads, thus anything automatic from the browser isn't going to work. So you'll need to implement your own deep linking unless your templates are completely static. In which case you don't have to use hashes.