如何在<a href="" url="" link="" -="" ionic="" to="" open="" external="" page=""

时间:2018-03-30 10:00:27

标签: angular typescript ionic-framework ionic2 ionic3

="" 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

2 个答案:

答案 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>