如何在angular-cli的组件内使用电子浏览器窗口?

how to use electron browser window inside components in angular-cli?(如何在angular-cli的组件内使用电子浏览器窗口?)
本文介绍了如何在angular-cli的组件内使用电子浏览器窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

Angular-cli 不接受组件内部的电子.如何在angular-cli的组件内使用电子浏览器窗口?我得到一个像这样的错误 fs.existsync .有没有其他选项可以将电子与 angular2 组件一起使用?

Angular-cli doesn't accept the electron inside components. how to use electron browser window inside components in angular-cli? I got an error fs.existsync like this. Is there any other options to use electron with angular2 components?

var electron = require('electron');

   import electron from 'electron';

两者都不能在 ts 中工作?

Both are not working inside ts?

推荐答案

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-2.1.1.js"></script>
<title>Workdesk 2.0</title>
<!--<base href="./">-->
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="styles.css">
<script src="assets/jquery.js"></script>
</head>
<body style="margin: 0px;">
<app-root></app-root>
<script>
var electron = require('electron');
var BrowserWindow = require('electron').remote.BrowserWindow;
var ipcMain = require('electron').remote.ipcMain;
var shell = require('electron').shell;
var Positioner = require('electron-positioner');
var path = require('path');
var gkm = require('gkm');
var fs = require('fs');
var os = require('os');
var path = require('path');
var base64Img = require('base64-img');
var ip = require('ip');
</script>
</body>
</html>

这将帮助您使用任何脚本语言(如 angular2、react js、node js 等)与电子通信,

This will help you to communicate with electron in any of the script languages like angular2,react js, node js etc.,

这篇关于如何在angular-cli的组件内使用电子浏览器窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Google apps script get range of bytes from binary file(谷歌应用程序脚本从二进制文件中获取字节范围)
Sending Multiple attachments with Google Script from Google Drive(使用 Google 脚本从 Google Drive 发送多个附件)
Distributing Google Apps Scripts for Sheets in your company network(在您的公司网络中分发适用于表格的 Google Apps 脚本)
Upload file to my google drive from anyone using javascript(使用 javascript 将文件从任何人上传到我的谷歌驱动器)
quot;Shared Drivequot; support in Google Apps Script(“共享驱动器Google Apps 脚本中的支持)
Angular 2+ HTTP POST and GDrive API. Resumable file upload with name(Angular 2+ HTTP POST 和 GDrive API.带名称的可恢复文件上传)