Angular binding for tel number

2019-07-22 15:37发布

问题:

I trying to bind a telephone number which comes from a Json object loaded from a server. What's my mistake?

<a ng-href="tel:{{card.phone}}"><i class="fa fa-phone redicon fa-2x"></i></a>

This is the data:

"phone": "+4199999999",

回答1:

No need for interpolation with angular directives (such as ng-href):

<a ng-href="tel:card.phone"><i class="fa fa-phone redicon fa-2x"></i></a>


回答2:

If Phone number is not being detected then you might want to check for following line in header part

<meta name="format-detection" content="telephone=no">

OR you can set

<meta name="format-detection" content="telephone=yes">

to get it working.

Regards.