[英]href=“tel:” does not work on ionic 3
I think href
is available on an a
, but not an ion-item
element. 我认为href
可用于a
,但不是ion-item
元素。 So you want either: 所以你想要:
<a ion-item href="tel:..."><ion-icon>...</ion-icon></a>
or 要么
<ion-item>
<a href="tel:..."><ion-icon>...</ion-icon></a>
</ion-item>
(In these examples, replace the ...
with the appropriate content.) (在这些示例中,将...
替换为适当的内容。)
call this method from your html 从你的HTML调用这个方法
<button ion-button (click)="callNumber(1236547890)">Call Number</button>
and in .ts write this 并在.ts写这个
callNumber(phoneNumber){
window.open('tel:' + phoneNumber, '_system');
}
Must work in ios and android 必须在ios和android中工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.