How to set up my electron application using angular.js?

I am trying to create electron application using angular.js, but somehow, i can’t make it to go to my default view, all other views work perfectly, but when my path is “/” it sends me always to otherwise part.

I tried both
$locationProvider.html5Mode({enabled: true, requireBase: false});
and
$locationProvider.html5Mode({enabled: true, requireBase: true});
with
<base href="/">,
and every other route is working except my “/” route. When I try the same in browser, it works like a charm.

Considering that i haven’t finished yet my “Register” part, i set up, that when clicked, it sends you to “/”, and it also works. The only thing that won’t work is when first time entering “/” route.

Can somebody explain what I am doing wrong?

This is my “index.html”:

<head>
    <title>DEMO APP MINZE</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700&display=swap" rel="stylesheet"/>
    <link rel="stylesheet" href="css/main.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="js/scripts.js"></script>
    <script src="views/templates.js"></script>
<!--    <base href="/">-->
</head>
<ul>    
    <li><a href="/#/login" class="login">Login</a</li>
    <li><a href="/#/" class="register">Register</a></li>    
</ul>

This is my electron part:

function createMainWindow() {

    win = new BrowserWindow({
        width: 800, height: 600, show: true, webPreferences: {
            preload: path.join(__dirname, 'preload.js'),
            nodeIntegration: false
            //contextIsolation: true,
        }
    })
    win.loadURL(url.format({
        pathname: path.join(__dirname, './dist/index.html'),
        protocol: 'file',
        slashes: true
    }));
};

function createWindows() {
    createMainWindow();
    //createChildWidnow();
}

app.on('ready', () => {

    createWindows();
    //win.webContents.openDevTools();
    win.on('closed', () => {
        console.log('cao cao');
        win = null;
    })
});

And this is my angular routing:

angular.module('templates', [
    'ngRoute',
    'app'
])
.config(($routeProvider,$locationProvider)=>{
    $locationProvider.hashPrefix("");
    $routeProvider
        .when('/',{
            templateUrl : "welcome.html"
        })
        .when('/login',{
            templateUrl : "login.html",
            controller : "loginCtrl"
        })
        .when('/success',{
            templateUrl: 'success.html',
            controller: "successCtrl"
        })
        .otherwise({
            template : "<h1>Error 404 !!!</h1>"
        });
    $locationProvider.html5Mode({enabled: true, requireBase: false});
});


Source: AngularJS