Simplified routing views:
There is two Views, View1 and View2. Here are how they are in manifest file.
Part of manifest.json:
routes section defines a name, a pattern, and one or more targets to navigate to when the route has been hit.
The targets section we find the view associated.
View1.view.xml. In this file we call the function goToView2:
Controller of View1:
Controller of View2. Here we did the navigation back function:
This is it, just a simple go and back pages.