1

How do I open Angular routerLinks in New Windows, Not New Tabs?

<a  
  target="_blank"
  [routerLink]="['/product/',productData?.productId]"
>

This is not working in the latest Chrome per 2020 (still opening tabs)

2 Answers2

1

You can achieve it using window.open method. Below is example for opening link in new window.

<a href="'/product/' + productData?.productId" target="popup" (click)="window.open('/product/' + productData?.productId,'name','width=600,height=400')">Open page in new window</a>

Check this website for reference. https://www.rapidtables.com/web/html/link/html-link-new-window.html

Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80
0
<a onclick="window.open('/product/' + productData?.productId)"></a>
Aarji George
  • 599
  • 4
  • 8