1
votes

I use Polymer starter kit to build my app. I removed the hashbang in the urls.

I am trying to build a login screen and after successful login, I want to change the page to default route. To do this, I have a listener in app.js for successful log in. On successful log in, I change the route which causes page refresh. I tried multiple options:

  1. location = 'entireUrl'
  2. location.pathname = '/route'
  3. location = 'route'

All the options causes page refresh. Is there any way to code this without causing page refresh. Shouldn't page.js catch this and do the routing without page refresh?

1

1 Answers

4
votes

For those looking for an answer, I fixed it by calling page.redirect('/route').

note: page.redirect will replace the browser history. If you want to retain browser history you can use page.show('/route')