javascript - Electron : Menu redirect to component (with Angular 4) -


this first project angular 4 , electron desktop application.

i have override electron menu don't know how redirect component when click on submenu item.

this part of menu.

const template = [ {     label: 'options',     submenu: [         {label: 'login', click(){gotoacomponent();}},         {label: 'quitter', 'role': 'quit'}     ] }]; 

can me ?

in electron click handler send event:

const template = [ {    label: 'options',    submenu: [      {label: 'login',          click(){           mainwindow.webcontents.send('customevent', customarg);         }      },      {label: 'quitter', 'role': 'quit'}    ] }]; 

and in angular controller, listen event:

var ipc = require('electron').ipcrenderer; ipc.on('customevent', function(sender, customarg) {   invokeyouractionhere(); }); 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -