From http://stackoverflow.com/questions/12700145/how-to-format-a-telephone-number-in-angularjs