**Hi i am not able to format the phone number with is displaying on pageload format should be "123-456-7890" i tried different scenario but not getting . can any one help me regarding this.
angular.module("smbApp")
.directive("controlDeviceSummary", function(){
return {
restrict: 'E',
templateUrl: 'templates/device_summary.template',
controller: 'DeviceSummaryCtrl'
}
.directive("formatPhone",function(){
return{
link:function (scope, element, attr){
var phoneforamt= function(value){
var value = value.replace(/(\d{3})(\d{3})(\d{4})/);
}
}
}
})
});
<tbody>
<tr ng-repeat="detail in details track by $index">
<td><a href="#">{{detail.firstName}}, {{detail.lastName}}</a></td>
<td><a href="#" formatPhone >{{detail.mobileNumber}}</a></td>
</tr>
</tbody>
**