0

I'm trying to redirect the user to a specific page with ${id} opening a new tab after clicking a button in an angular material dialog box, because I want to keep the dialog box open while I query the open page in the other tab, currently the redirect occurs but not in a new tab, What would be the solution to open in new tab?

I tried using

this.router.navigate([`client/sl`])

I also tried using

this.router.navigateByUrl([`client/sl?id=${this.data.dispatch.id}&tab=`] )

but I was unsuccessful.

Using window.open() is working, but I don't know if it's the most suitable solution as it doesn't transition smoothly.

JSON Derulo
  • 9,780
  • 7
  • 39
  • 56
Nunes
  • 1
  • 1
  • Similar to https://stackoverflow.com/questions/41531244/how-to-open-a-new-tab-with-router-navigate-in-typescript – Syperia May 11 '23 at 13:26

1 Answers1

0

Here you can try this.

this.router.navigate([]).then(result => {  window.open(link, '_blank'); });