View.router.navigate('/') doesn't work


Here is my problem: when i navigate from my main view (path: ‘/’) to an another page like (/about/). I cant navigate back to the home page with the method "mainView.router.navigate(’/’).
There is some of the code:

routes = [
path: ‘/’,
url: ‘./index.html’,
path: ‘/registro/’,
url: ‘./pages/registro.html’,
path: ‘/login/’,
url: ‘./pages/login.html’,
path: ‘/donar/’,
url: ‘./pages/donar.html’,
path: ‘/about/’,
url: ‘./pages/about.html’,
path: ‘/form/’,
url: ‘./pages/form.html’,
// Default route (404 page). MUST BE THE LAST
path: ‘(.*)’,
url: ‘./pages/404.html’,

in my index.html

>  <div class="view view-main ios-edges">
>       <!-- Page, data-name contains page name which can be used in callbacks -->
>       <div class="page" data-name="home">
>         <!-- Top Navbar -->
>         <div class="navbar">
>           <div class="navbar-inner">
>             <div class="left">
>               <a href="#" class="link icon-only panel-open" data-panel="panel-left">
>                 <i class="icon f7-icons ios-only">menu</i>
>                 <i class="icon material-icons md-only">menu</i>
>               </a>
>             </div>
>             <div class="title sliding">Home</div>
>           </div>
>         </div>
>         <!-- Scrollable page content-->
>         <div class="page-content">
>           <div class="block block-strong">
>             <p>Here is your blank Framework7 app. Let's see what we have here.</p>
>           </div>

in my app.js

var mainView = app.views.create('.view-main', {
url: '/'

when i test the navigation in the console this happen
load the app with the mainView and the page “home”. I use this method "mainView.router.navigate(/about/)…that work. And when i want to go back to the home page with “mainView.router.navigate(/)”… nothings happen im still in the about page.
Any solution? Sorry for my english.


You need to disable pushState first if it is activated!

Two, you need not to have anything in your anything in your mainView at app init… You can define it later in your app.js like you’re doing and then everything else will work as expected…

This portion of the documentation will help you! If you use pushState, make sure you define it well including it’s root…

It has something to do with your initial pages…


are you saying what i need to do is leaving my mainView empty (just the page and page-content)?
What you mean with “anything in your mainView at app init”?
I’m asking this because i was reading the docs and i’m understanding but… this problem is still happening and no response to any logic.


Yes… Remove the view-init class…from creation of your view… I had the same issue some day…

Follow thru this: [SOLVED] Initial page and local storage


Remove this… Let your view be empty…

Also, use app.router.navigate ('/')… This will always fallback to your mainView