I have tried to open redirect external website when button click in Angular , but its not working , Please help
<button [routerLink]="www.google.com" >
Goto google
</button>
I have tried to open redirect external website when button click in Angular , but its not working , Please help
<button [routerLink]="www.google.com" >
Goto google
</button>
You can use anchor tag for the same, using target
as _blank
will cause this to open in a new tab. Remove it if you need to redirect to the same tab.
<a href="www.google.com" target="_blank">Go to Google</a>
If you want to use button, try below:
<button onclick="window.location.href='https://google.com';" value="Go to Google" />
<a href="https://www.google.com/">Goto google</a>
This will redirect the user to Google website
[routerLink]
is for internal URL (within your Angular App)