Confused about router.navigate

I am having trouble making a button going back to my homepage.
But now i have a simple button on the homepage and want to control it with an on Click event handler.

I have set upt my routes at my app-initialization. All routes have a name, path and url.
Question 1: Does this initialization mean that they are created or do i have to create each view manualy through something like this AGAIN?

var myView = app.views.create('#theView', {
  url: '/settings/',
  name: 'settings'
});

I am confused because i have already set these params in my app ini through ROUTES.

Question 2 In the docs i read that i only need to write as example:
router.navigate({ name: 'settings' });
But i found on the net that others put the app in front of it dedicated to the var at the initalization, so that it looks like this
app.router.navigate({ name: 'settings' });

I am setting the on click handler inside the ROUTES -> on -> pageInit event handler. Is this the correct way where to insert my own javascript code or shall it go insid each page found in the folder pages/settings.html ?

Thanks in advance for your support and time!

app.router.navigate({ name: 'settings' }); => view1.router.navigate({ name: 'settings' });

1 Like

Question 1: var myView is a Javascript reference to the element on a page that your programs can reference.

1 Like