Closed andyrue closed 2 years ago
I cloned a new project, added a simple function call to the ipcRenderer and it comes back as undefined. Not sure what I'm doing wrong.
ipcRenderer
import { Component, OnInit } from '@angular/core'; import { ElectronService } from '../core/services'; @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { constructor( private electronService: ElectronService ) { } ngOnInit(): void { } test() { console.log('testing call (client)') this.electronService.ipcRenderer.send('test'); } }
ERROR TypeError: Cannot read properties of undefined (reading 'send')
You have to test if you are in an electron context before calling ipcRenderer
Have a look at app.component.ts
app.component.ts
I cloned a new project, added a simple function call to the
ipcRenderer
and it comes back as undefined. Not sure what I'm doing wrong.ERROR TypeError: Cannot read properties of undefined (reading 'send')