0

This is my function which directs to the page route

.ts file

readmoreFunc(data:any){
this.showId = data._id;
this.contentType =data.type
this.router.navigate(['/dashboard/dashboard-content/', this.showId,this.contentType])}

showId and contentType are my params. for eg"(http://localhost:4200/dashboard/dashboard-content/ckhewcmcj000v98t9zcb89rz0/Recent-Post) i want to open it in another tab in chrome.

  • Does this answer your question? [Can vue-router open a link in a new tab?](https://stackoverflow.com/questions/40015037/can-vue-router-open-a-link-in-a-new-tab) – Felipe Endlich Nov 13 '20 at 14:40

1 Answers1

0

Try this,

 const url = this.router.serializeUrl(
        this.router.createUrlTree([`/dashboard/dashboard-content/${this.showId}/${this.contentType}`])
      );
 window.open(url, '_blank');
bahadrdsr
  • 424
  • 3
  • 7