JSFiddle - React, Tailwind, and code Playground
by lesouthern
HTML
<div ng-app="pageModule"
ng-controller="pageCtrl"
class="">
<a href="{{number | telanchor}}">Tel number</a>
</div>
JavaScript
var pageModule = angular.module('pageModule',[])
.filter('telanchor',function() {
return function(s) {
var rString = '';
if(typeof s !== 'undefined' && angular.isString(s)) {
rString = 'tel:+' + s.replace(/\D/g,'');
}
return rString;
}
})
.controller('pageCtrl',function($scope) {
$scope.number = '510-338-1927';
});