0

I am trying to open a URL in new window by clicking on menu item in angular but I don't know a method of doing such thing in _nav.ts file. Below is the code of my menu item

    {
        name: 'Power BI',
        url: "window.open('www.google.com', '_blank')",
        icon: 'fa fa-archive',
        version: '0.0.1',
        key: 'VIEW_EXTERNAL_POWERBI',
    }

Please help me out how to achieve this thing.

*Note: I want to open link in new window instead of new tab.

Thank you

Dev
  • 111
  • 1
  • 13

1 Answers1

0
<button (click)="handleClick()" >click</button>

handleClick(){const url = 'https://www.google.com';
window.open(url, '_blank');}

TRY THIS

Mohamed Rashiq
  • 322
  • 1
  • 3
  • 12
  • I know how to open it with a button. I need to do it on menu click in nav.ts file – Dev Oct 28 '19 at 05:48