Polymer Routing with page.js do not add hashbang t

2019-07-31 17:30发布

I am using polymer starter kit which uses page.js for routing. The hashbang page option is set to true in routing.html

// add #! before urls
page({
  hashbang: true
});

when links such as <a href="/products/productname"></a> are clicked, the #! is added and the resulting url looks like this: http://localhost:3000/#!/products/productname but when the links are opened in a new browser tab, they look like this http://localhost:3000/products/productname. How can I have the #! added when links are opened in new tab?

1条回答
等我变得足够好
2楼-- · 2019-07-31 17:33

you have to write

<a href="#!/products/productname"

in every your href

查看更多
登录 后发表回答