Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Onsen-UI how to dial with ng-click inside <ons-button>

I am trying to make an ons-button using ng-click to dial a number when it is clicked, in both iOS & Android. I use Cordova framework.

I have used the followings but with no success:

    <ons-button ng-click="window.open('tel: {{69000000}}', '_system')">Call</ons-button>
    <ons-button ng-click="window.location.href('tel: {{69000000}}', '_system')">Call 2</ons-button>

In config.xml I have enabled

    <access origin="tel:*" launch-external="yes" />
like image 449
Cadmos Avatar asked Feb 04 '26 19:02

Cadmos


1 Answers

I had the same problem, and in my case, I inserted a simple href. For example,
<a href="tel:123456789">123456789</a>
Hope this helps! :)

like image 170
Antonio Herreros Avatar answered Feb 06 '26 10:02

Antonio Herreros