I need to call a php page from IONIC. In home.html
i am calling a url as shown below -
<a target="_blank" href="https://www.example.com?">pdf</a>
How do i add a variable from home.ts
and make it
<a target="_blank" href="https://www.w3schools.com?ADAM">pdf</a>
In home.ts
i have a variable name = "ADAM";
Please advise how do i join this on home.html side inside
答案 0 :(得分:1)
在home.ts中定义变量 即。
var url="https://www.w3schools.com?name=ADAM"
然后你可以从html中访问它,如
<a target="_blank" href="{{url}}">pdf</a>
答案 1 :(得分:0)
尝试使用queryparam
<a [routerLink] = "your url" [queryParams] = "{ m : [selectedMonth.id] }" queryParamsHandling="merge">
Test
</a>