Can't create view with view parameters


I need to set the url of the initial view on creating the view:

if (data.member_permission == null || data.member_permission < 2) {
          startUrl = '/login/';
        } else {
          startUrl = '/home/';

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

But if I have declared view parameters before, it is not working:

 var app = new Framework7({
      id: 'io.framework7.testapp',
      el: '#app',
      theme: theme,
      cache: false,
      autoDarkTheme: true,
      view: {
   name: 'main',
      xhrCache: false,
      browserHistory: true,
      browserHistoryRoot: "/homework/f7/",

It seems to be the “browserHistory: true” that causes the problem. With this parameter the view is not created: nothing is loaded. When I uncomment “browserHistory: true”, the view is loaded correctly. (But I think xhrCache:false is ignored…)

Can you help me?

Thank you!


i think you should do it in routes, if logged ok routes pages else redirect to login page

Yes, I do that but for the first/start page this does not work.
So I followed “nolimits4web”'s instructions from here: Select which page to load first - #5 by nolimits4web

But as I said, browserHistory and no cache is not working anymore, when loaded like that.