I am using angular 4 and in template (.html), I coded as
<a *ngHref="tel:{{orders.billing_address.telephone}}"> <span> Call : </span>
It throws an error as
Can't bind to 'href' since it isn't a known native property a
I search it and get angular 4 use [routerLink]. But I don't know how to use [routerLink] to set tel: numbers. Could you please guide me.
I am using angular 4 and in template (.html), I coded as
<a *ngHref="tel:{{orders.billing_address.telephone}}"> <span> Call : </span>
It throws an error as
Can't bind to 'href' since it isn't a known native property a
I search it and get angular 4 use [routerLink]. But I don't know how to use [routerLink] to set tel: numbers. Could you please guide me.
Share edited Sep 15, 2017 at 13:12 mxr7350 1,4583 gold badges22 silver badges30 bronze badges asked Sep 15, 2017 at 13:06 Tamil Selvan CTamil Selvan C 20.3k12 gold badges54 silver badges71 bronze badges 1- Please visit angular.io/api/router/RouterLink – Ramesh Rajendran Commented Sep 15, 2017 at 13:15
2 Answers
Reset to default 4Just href
inside []
. It will let you to remove {{}}
part. And if you want to concatenate strings inside, you need to create a string like 'tel:' + otherParts
<a [href]="'tel:' + orders.billing_address.telephone"> <span> Call : </span>
use the [href]
in angular 2
<a [href]="'tel:'+ orders.billing_address.telephone"> <span> Call : </span>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745069165a4609438.html
评论列表(0条)