Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
libphonenumber-js: format and validate phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Oct 15, 2013
1 parent 52b7b34 commit bd1c349
Show file tree
Hide file tree
Showing 3 changed files with 1,354 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libphonenumber.js/index.html
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>
13 changes: 13 additions & 0 deletions libphonenumber.js/libphonenumber-js.html
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>
Loading

0 comments on commit bd1c349

Please sign in to comment.