angular-electron
angular-electron copied to clipboard
Menu
Hi,
this is exactly what I need. Thank you!
But I have problems with implementing menus. I tried to extend constructor of ElectronService class:
const template = [
{label: 'first', click: () => { console.log('clicked first'); }},
{label: 'second', click: () => { console.log('clicked second'); }}
];
if (process.platform === 'darwin') {
const name = this.remote.app.getName();
console.log('name is: ', name); // this yields: angular-electron but menu shows "Electron"
template.unshift({
label: 'Electron',
click: () => { console.log('clicked Electron'); }
});
}
const menu = this.remote.Menu.buildFromTemplate(template);
this.remote.Menu.setApplicationMenu(menu);
but with no luck. Would be thankful for a hint.
works for Windows :|
Sorry don't know the answer to your question, but just so you know, if you place three back-ticks (the same key as ~) before and after your code,
It will appear nicely formatted, like this