Есть очень простое решение в угловых без маски, но с модулем фильтра: {{phoneData | tel}}
.filter('tel', function() {
return function (tel, params) {
if (!tel) { return ''; }
var options = params || {};
var plus = tel.toString().trim()[0] === '+' ? '+' : '';
var value = tel.toString().trim().replace(/^\+/, '').replace(/\-/g,'');
if (value.match(/[^0-9]/)) {
return tel;
}
var country, city, number;
switch (value.length) {
case 10: // +1PPP####### -> C (PPP) ###-####
country = 1;
city = value.slice(0, 3);
number = value.slice(3);
break;
case 11: // +CPPP####### -> CCC (PP) ###-####
country = value[0];
city = value.slice(1, 4);
number = value.slice(4);
break;
case 12: // +CCCPP####### -> CCC (PP) ###-####
country = value.slice(0, 3);
city = value.slice(3, 5);
number = value.slice(5);
break;
default:
country = "";
city = value.slice(0, 3);
number = value.slice(3);
break;
}
if (country === 1 || options.country === false) {
country = "";
plus = "";
}
if(number){
if(number.length>3){
number = number.slice(0, 3) + '-' + number.slice(3);
}
else{
number = number;
}
return (plus + country + " (" + city + ") " + number).trim();
}
else{
return (plus + country + " (" + city).trim();
}
};
})