从路由器链接中删除localhost:4200 / xxx

初学者

我想使用angular 7中的路由器链接重定向到另一个链接,但是localhost:4200 / dashboard附加到我要重定向的链接上。

 <a  [routerLink]="https://google.com">Google</a>

当我单击Google时,它应该重定向到https://google.com,正在调用localhost:4200 / dashboard / https://google.com

哈伦·伊尔马兹(Harun Yilmaz)

routerLink用于Angular的内部路由。如果要导航到外部URL,只需hrefa标记一起使用

<a  href="https://google.com">Google</a>

RouterLink:https://angular.io/api/router/RouterLink

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章