This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libphonenumber-js: format and validate phone numbers
- Loading branch information
Yvonne Yip
committed
Oct 15, 2013
1 parent
52b7b34
commit bd1c349
Showing
3 changed files
with
1,354 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<link href="libphonenumber-js.html" rel="import"> | ||
<script src="../../polymer/polymer.js"></script> | ||
</head> | ||
<body> | ||
<polymer-element name="libphonenumber-demo" noscript> | ||
<template> | ||
<libphonenumber-js phone="{{phone}}" valid="{{valid}}" formatted="{{formatted}}"></libphonenumber-js> | ||
<input value="{{phone}}"><br> | ||
<p> | ||
Valid: {{valid}}<br> | ||
Formatted: {{formatted}} | ||
</p> | ||
</template> | ||
</polymer-element> | ||
<libphonenumber-demo></libphonenumber-demo> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script src="libphonenumber.js"></script> | ||
<polymer-element name="libphonenumber-js" attributes="country phone valid formatted"> | ||
<script> | ||
Polymer('libphonenumber-js', { | ||
country: 'US', | ||
valid: false, | ||
phoneChanged: function() { | ||
this.formatted = formatLocal(this.country, this.phone); | ||
this.valid = isValidNumber(this.country, this.phone); | ||
} | ||
}); | ||
</script> | ||
</polymer-element> |
Oops, something went wrong.