我想使用angular 7中的路由器链接重定向到另一个链接,但是localhost:4200 / dashboard附加到我要重定向的链接上。
<a [routerLink]="https://google.com">Google</a>
当我单击Google时,它应该重定向到https://google.com,但正在调用localhost:4200 / dashboard / https://google.com。
routerLink
用于Angular的内部路由。如果要导航到外部URL,只需href
与a
标记一起使用:
<a href="https://google.com">Google</a>
RouterLink:https://angular.io/api/router/RouterLink
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句