0

I want to have a webpage which gets opened up in a new tab when a link/button is clicked. I am not sure how do i implement this in angular 8

sd_30
  • 576
  • 1
  • 6
  • 21
  • https://html.com/attributes/a-target/#:~:text=browser%20specifies%20otherwise.-,a%20target%3D%E2%80%9D_blank%E2%80%9D%20Open%20in%20New%20Browser%20Tab%20(,older%20browsers)%20a%20new%20window. `` should work. – AliF50 Aug 13 '20 at 18:54
  • what should i put in href = "..." ? I need to open a webpage when the link/button is clicked – sd_30 Aug 13 '20 at 18:56
  • In the href, put the link of the webpage you would like to be opened in the new tab. – AliF50 Aug 13 '20 at 18:59

2 Answers2

1

Simple as this:

<a target="_blank" href="http://www.netflix.com/">Welcome to Netflix Dhiman ji</a>
  • Please look for duplicates of questions such as these. Note also that someone has already suggested a duplicate which has an answer exactly the same as yours. – Heretic Monkey Aug 13 '20 at 19:35
0

You have another options as below

Typescript file 
link() {
window.open('http://www.netflix.com/',_blank);
}

HTML file
<button (click)='link()'>Welcome to Netflix</button>
Muthupriya
  • 345
  • 1
  • 10