-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
In folder providers in electron.service.ts I have problem:
import { Injectable } from '@angular/core';
// If you import a module but never use any of the imported values other than as TypeScript types,
// the resulting javascript file will look as if you never imported the module at all.
import { ipcRenderer, webFrame, remote, BrowserWindow } from 'electron';
import * as childProcess from 'child_process';
import * as fs from 'fs';
@Injectable()
export class ElectronService {
ipcRenderer: typeof ipcRenderer;
webFrame: typeof webFrame;
remote: typeof remote;
childProcess: typeof childProcess;
win: BrowserWindow;
fs: typeof fs;
constructor() {
// Conditional imports
if (this.isElectron()) {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.webFrame = window.require('electron').webFrame;
this.remote = window.require('electron').remote;
this.win = window.require('electron').remote.getCurrentWindow();
this.childProcess = window.require('child_process');
this.fs = window.require('fs');
}
}
isElectron = () => {
return window && window.process && window.process.type;
}
}
When I write in my project
win: BrowserWindow;
I get error Cannot find name 'BrowserWindow'. What is wrong? I did
import { ipcRenderer, webFrame, remote, BrowserWindow } from 'electron';
I can't rewrite instead win: typeof BrowserWindow;
because in method toggleFullScreen() will not be to able method isFullScreen(), show(),setFullScreen().
App work good in develop mode, but I have error and I can't build exe file. How fix that?
Metadata
Metadata
Assignees
Labels
No labels