Routes login screen HELP?!


I am currently working on a login screen however i am stuck at the following:

in my routes.js file i have put the following code:

var loginResponse = 1;
var routes = [
    path: '/welcome/',
    async(routeTo, routeFrom, resolve, reject) {
      if (loginResponse != 1) {
          componentUrl: './features/welcome/src/templates/welcome-screen.html',
      } else {
            url: './pages/about.html'

Where “loginResponse” stands for successfull authenicated or not. 1 = successul and 0 is unsuccesful.
In my index.html page I have a button which calls this route "/welcome/’. which works perfect. See code button:

<a href="/welcome/" class="button">Open As Page</a>

However I want to achieve calling the route automatically when the index page is loaded. I tried to change path: '/welcome/', to path: '/', but it does not work. I have tried also a lot of different stuff but with no result.

Does somebody know how to automatically call for this route when the index page is loaded?


You need to set url: '/welcome/' parameter on your main View (to set its default URL). And to force View to load it in the beginning, its HTML should be empty (e.g. no any default child pages)