角/电子不发射

问题描述

我已经使用angular-CLI创建了一个angular 10项目。之后,我已经安装了Electron并完成了此操作:将src / index.html base更改为Localed Installed Electron。但是运行我的代码时,它显示出一些错误。

如何解决此错误?

这是我的 main.js 文件

The array of objects is looking like this : 

 testContact = {
    _objectInstance: {
      id: 3,rawId: null,displayName: null,name: {
        givenName: "John",honorificSuffix: "",formatted: "John Appleseed",middleName: "",familyName: "Appleseed",honorificPrefix: "",},nickname: "",phoneNumbers: [
        { value: "888-555-5512",pref: false,id: 0,type: "mobile" },{ value: "888-555-1212",id: 1,type: "home" },],emails: [
        { value: "[email protected]",type: "work" },addresses: [
        {
          pref: "false",locality: "Atlanta",region: "GA",postalCode: "30303",country: "USA",type: "work",streetAddress: "3494 Kuhl Avenue",{
          pref: "false",type: "home",streetAddress: "1234 Laurel Street",ims: null,organizations: [
        { pref: "false",title: "",name: "",department: "",type: null },birthday: "1980-06-22T12:00:00.000Z",note: null,photos: null,categories: null,urls: null,};

这是我的 package.json 文件

const { app,BrowserWindow } = require('electron')

let win;

function createWindow () {
  // Create the browser window.
  win = new BrowserWindow({
    width: 600,height: 670,icon: `file://${__dirname}/dist/assets/logo.png`
  })

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

  // uncomment below to open the DevTools.
  // win.webContents.openDevTools()

  // Event when the window is closed.
  win.on('closed',function () {
    win = null
  })
}

// Create window on electron intialization
app.on('ready',createWindow)

// Quit when all windows are closed.
app.on('window-all-closed',function () {

  // On macOS specific close process
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate',function () {
  // macOS specific close process
  if (win === null) {
    createWindow()
  }
})

这是我的 index.html 文件

{
  "name": "angu","version": "0.0.0","main": "main.js","scripts": {
    "ng": "ng","start": "ng serve","build": "ng build","test": "ng test","lint": "ng lint","e2e": "ng e2e","electron":"electron .","electron-build": "ng build --prod && npm run electron ."
  },

error

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)