1

In our application, on a button click within a table, I need to open a new tab containing details of a record in the table. Using the below code I am navigating to a new URL. On the new page, resolvers are used to fetch details from back-end. Now the problem is I want to open this in a new tab.

 this.router.navigate(['/url/test'], {
      queryParams: {ip},
    }); 

I tried the below code. But it doesn't seems to work. It is redirecting to the default URL:

    this.router.navigate([]).then((result) => {
      window.open('/url/test?aa=' + aa, '_blank');
    });

Any help would be appreciated.

1
  • 1
    You don't the router to open a window. Remove the call to router.navigate and just call window.open. Commented Sep 4, 2020 at 10:41

1 Answer 1

4

I was using useHash as true for my urls, so when i navigated with hash in url it started working.

    this.router.navigate([]).then((result) => {
      window.open('/#/url/test?aa=' + aa, '_blank');
    });

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.