I am trying to get a route to an external URL. Below is my example so far.
The error I am getting is:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'https:/google.com'
Error: Cannot match any routes. URL Segment: 'https:/google.com'
here is my code
ViolatorLink() {
this.router.navigate(['https://www.google.com/'], {
queryParams: {mid: this.mid}
}
);
}
Ideally, you should use the window.location.href = "https://www.google.com";
for your external URL calls because this.router.navigate
looks the URL in angular routings
.
Your function should be like:
ViolatorLink() {
window.location.href = "https://www.google.com";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With