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.js
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.