angular-electron icon indicating copy to clipboard operation
angular-electron copied to clipboard

Menu

Open richlim opened this issue 8 years ago • 2 comments

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.

richlim avatar Dec 03 '18 18:12 richlim

works for Windows :|

richlim avatar Dec 03 '18 19:12 richlim

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 

whyboris avatar Dec 04 '18 16:12 whyboris