ElectronJS + Angular CLI,不热重载?在file:// protocol下

时间:2017-03-22 21:44:52

标签: electron angular-cli

我使用angular CLI(Angular 2)

建立了我的第一个使用electronJS的应用程序

我一直在按照基本指南开始,但在所有示例中,他们发表评论我必须添加一些行。

在我的 index.html put

Fatal error: Uncaught Http\Client\Exception\NetworkException: Could not resolve host: www.linkedin.com in /var/www/html/vendor/php-http/curl-client/src/Client.php:134 Stack trace: 
#0 /var/www/html/vendor/happyr/linkedin-api-client/src/Http/RequestManager.php(37): Http\Client\Curl\Client->sendRequest(Object(GuzzleHttp\Psr7\Request))
#1 /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php(124): Happyr\LinkedIn\Http\RequestManager->sendRequest('POST', 'https://www.lin...', Array, 'grant_type=auth...')
#2 /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php(76): Happyr\LinkedIn\Authenticator->getAccessTokenFromCode(Object(Happyr\LinkedIn\Http\UrlGenerator), 'AQTWSqlSdfv3Fy_...')
#3 /var/www/html/vendor/happyr/linkedin-api-client/src/LinkedIn.php(293): Happyr\LinkedIn\Authenticator->fetchNewAccessToken(Object(Happyr\LinkedIn\Http\UrlGenerator))
#4 /var/www/html/vendor/happyr/linkedin-api-client/src/LinkedIn.php(95): Happyr\LinkedIn\LinkedIn->getAccessToken()
#5 /var/www/html/index.php(9): Happ in /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php on line 128

  <base href="/">

并加入 package.json 添加

  <base href="./">

但是,在问题成功时,我正在工作并将功能更改为angular 2应用程序,这不是更改,因为在命令

"build-electron": "ng build --base-href . && copy src\\electron\\* dist",
"electron": "npm run build-electron && electron dist"

创建一个已编译的副本(dist),但我在开发人员的帮助下尝试解决问题是因为我在协议文件下工作:// &# 39; electronjs&#39;

npm run electron 
"build-electron": "ng build --base-href

代替

  win.loadURL(`file://${__dirname}/index.html`)

并且不会在electronJS + angular cli中重新加载热量 我希望我能说清楚

0 个答案:

没有答案
相关问题