File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,22 +2,28 @@ import { Injectable } from '@angular/core';
2
2
3
3
// If you import a module but never use any of the imported values other than as TypeScript types,
4
4
// the resulting javascript file will look as if you never imported the module at all.
5
- import { ipcRenderer , webFrame } from 'electron' ;
5
+ import { ipcRenderer , webFrame , remote } from 'electron' ;
6
6
import * as childProcess from 'child_process' ;
7
+ import * as fs from 'fs' ;
7
8
8
9
@Injectable ( )
9
10
export class ElectronService {
10
11
11
12
ipcRenderer : typeof ipcRenderer ;
12
- childProcess : typeof childProcess ;
13
13
webFrame : typeof webFrame ;
14
+ remote : typeof remote ;
15
+ childProcess : typeof childProcess ;
16
+ fs : typeof fs ;
14
17
15
18
constructor ( ) {
16
19
// Conditional imports
17
20
if ( this . isElectron ( ) ) {
18
21
this . ipcRenderer = window . require ( 'electron' ) . ipcRenderer ;
19
- this . childProcess = window . require ( 'child_process' ) ;
20
22
this . webFrame = window . require ( 'electron' ) . webFrame ;
23
+ this . remote = window . require ( 'electron' ) . remote ;
24
+
25
+ this . childProcess = window . require ( 'child_process' ) ;
26
+ this . fs = window . require ( 'fs' ) ;
21
27
}
22
28
}
23
29
You can’t perform that action at this time.
0 commit comments