myView.router.back(url) doesn't work


I want to back to index page after few pages with using myView.router.back function.

But I can only back to the previous page not the index page.

i’m using routes to change page and using templateUrl for dynamic content.

function for the close button:

$$('.close').on('click', function (){

 url: ‘./index.html’,
 force: true,


Demo link:

path: index > urban > any project > click home button > index

Thanks for helping me.

you can do like this


router.back() works fine, its working as its supposed to
here is the doc of router.back()
Full doc

router.back(url, options) Go back to previous page, going back in View history
url string - url to navigate to (optional).
If not specified, then it will go back to the previous page in history.
If specified and there is previous page in history then it will be ignored.
If specified and there is a force: true option then will remove previous page from DOM and navigate back to the specified page URL
options - object with additional navigation properties (optional):
animate (boolean) - whether the page should be animated or not (overwrites default router settings)
pushState (boolean) - whether the page should be saved in browser state. In case you are using pushState, then you can pass here false to prevent route getting in browser history
ignoreCache (boolean) - If set to true then it will ignore if such URL in cache and reload it using XHR again
force (boolean) - if set to true then it will ignore previous page in history and load specified one

Try it

Example: app.router.back(url, options)

More infos:

1 Like