angular-electron
angular-electron copied to clipboard
ipRenderer.on doesnt see component variables
Sending event from main.js
, Angular receiving event, but can see any component variables.
Looks like ipcRenderer.on
dont see component variables, this example giving me undefined
in console (using latest master from GitHub).
public showProgress: boolean = false
constructor(
private es: ElectronService,
) {
}
ngOnInit(): void {
this.es.ipcRenderer.on("triedLogin", function (evt, success: boolean) {
console.log(this.showProgress)
})
}
I may be wrong, but doesn't "function" have it's own "this" scope? It should work if you use arrow syntax
Thanks @ac566, you're right :) I close the issue.