2017-01-04 45 views
1

所以在建立我的電子角2應用程序,當我運行它時,我的角2應用程序不再工作了。沒有錯誤出現,但應用程序不知道如何路由,所以它只是根據我的index.html被加載卡住。它有什麼與asar如何打包我的應用程序?我能做些什麼來使其重新運行? 文件結構:建築電子應用程序打破我的角2應用程序

./package.json

-----> ./電子/ main.js

src/---> index.html 
      app/app.routing.ts 
      app/app.component.ts 
      app/app.module.ts 
      app/home/home.component.ts 
      app/...All The other components...... 

的index.html:

<!doctype html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <title>New</title> 
    <script> 
    document.write('<base href="' + document.location + '" />'); 
    </script> 

    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="icon" type="image/x-icon" href="favicon.ico"> 

    <script>window.$ = window.jQuery = require('./public/jquery/dist/jquery.min.js');</script> 
    <script src="./public/bootstrap/dist/js/bootstrap.min.js"></script> 

    <link rel="stylesheet" href="./public/bootstrap/dist/css/bootstrap.min.css"> 

    <link rel="stylesheet" href="./public/bootstrap/dist/css/bootstrap-theme.min.css"> 

    </head> 
    <body> 
    <app-root> 
     Loading... 
    </app-root> 
    </body> 
</html> 

回答

0
href="' + document.location + '" 

替換爲

href="./" 

here是我該怎麼做