title: how to format the phone number in angualrjs?
body: <p>**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.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>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})/);
                       }
                  }
              }
          })
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;tbody&gt;
                      &lt;tr ng-repeat="detail in details track by $index"&gt;
                          &lt;td&gt;&lt;a href="#"&gt;{{detail.firstName}},&amp;nbsp;{{detail.lastName}}&lt;/a&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;a href="#" formatPhone &gt;{{detail.mobileNumber}}&lt;/a&gt;&lt;/td&gt;
                       &lt;/tr&gt;
  
                      &lt;/tbody&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>**</p>