繁体   English   中英

如何在 angular 中使用字符串插值添加 routerlink 而不是“a href”

[英]How to add routerlink instead “a href” with string interpolation in angular

我有一个完整的句子

I have read the <a href="xyz">Terms and Conditions</a>, <a href="xyz" target="_blank">Privacy Policy</a> and <a href="xyz">Legal Notice</a> and I fully agree to it without any concerns whatever blahblah

现在我们要使用 RouterLink 而不是 HTML -Tag。 但是我们不想将翻译分成多个部分并在最后连接起来(有时甚至不起作用,因为链接顺序因语言而异)。

有没有解决方案如何在 Angular 中实现这一点?

尝试使用:

组件.ts

xyz:any = '/page1';

组件.html

I have read the <a routerLink="{{xyz}}">Terms and Conditions</a>, <a routerLink="{{xyz}}" target="_blank">Privacy Policy</a> and <a href="xyz">Legal Notice</a> and I fully agree to it without any concerns whatever blahblah

这将帮助你......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM