angular
2016-11-15 42 views -1 likes 
-1

你好我的模板就像下面角2属性绑定没有双引号级联

<a [href]="'http://sameet.com?id='+testId"> 

它返回HREF链接为http://sameet.com?id=“12345”,但我需要证明http://sameet.com?id=12345

我已经尝试了很多方法像下面

<a [href]="'http://sameet.com?id=' {{testId}}"> 

但它返回相同的

+0

链接显示的第一个片段看起来不错,对我来说。你确定报价不是来自其他地方吗?除非是拼写错误,否则'='必须来自其他地方。 – cartant

+0

@cartant编辑问题请检查 – Niyaz

+0

第一个选项应该工作 – yurzui

回答

-3

你应该在HTML

<a [href]="http://sameet.com?id={{testId}}"> 

使用这样它会在浏览器http://sameet.com?id=12345

相关问题