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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -