ionic开发常用功能——点击拨打电话功能

来源:互联网 发布:宣传彩页设计软件 编辑:程序博客网 时间:2024/05/17 01:26

在ionic的应用中,经常会使用到点击直接拨打电话功能,这个在ionic中是如下实现的:

方法:

$scope.callPhone = function (phonenumber) {  console.log("拨打:" + phonenumber);  $window.location.href = "tel:" + phonenumber;};

注意:需要在ionic项目的config文件中添加如下代码

<access origin="tel:*" launch-external="yes"/>

注:IOS需要借助插件,具体参照链接资料

http://blog.csdn.net/yu17310133443/article/details/53100321点击打开链接

1 0