swipely / aviator

Aviator is a single-page front-end router built for modularity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why only match a.pathname in the click handler?

QingYun opened this issue · comments

I have an anchor points to a page like href="foo.html?bar=baz" and I really need that query string. Unfortunately, it got ignored in the navigator.

You need that queryString to match a route? Or does it simply include data that you need?
Though we don't match on queryStrings they should be sent to the matching route with the full url..

Can you tell me more about what and why so I understand the need better please? :)

I use it to pass data. The situation is I'm refactoring a small all-static site, which is basically a set of slides written as web pages, and my goal is to make them switching smoothly. So the HTML template rendering part has been moved to the front end. The data source is an array of objects, one object for one page. The problem is that the name of prerendered HTML file at the back end is actually kind of a hash of its data object. That means I cannot know which data object to use if I only got that hash from Aviator. I have to either maintain a hash to index map or pass the index as a part of its URL, and I chose the latter. That's the story.