How to open a new browser tab using a router from an angular 2 component?

I have an angular 2 component and you need to switch to a different route, but in a different browser tab. Below the code moves to the same browser tab.

import { Component } from '@angular/core'; import { Router } from '@angular/router'; @Component({ templateUrl: 'quotes-edit.component.html' }) export class QuoteComponent { constructor(private router: Router) { } this.router.navigate(['quote/add']); } 
+9
source share
1 answer

You would not use a corner router for this, but instead you could make a function that has the following

  openinbrowserclicked(url) { window.open( 'url', '_blank', 'toolbar=no,resizable=yes,scrollbars=yes' ); } 
0
source

Source: https://habr.com/ru/post/1013602/


All Articles