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

Commit bd1c349

Browse files
author
Yvonne Yip
committed
libphonenumber-js: format and validate phone numbers
1 parent 52b7b34 commit bd1c349

3 files changed

Lines changed: 1354 additions & 0 deletions

File tree

libphonenumber.js/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<link href="libphonenumber-js.html" rel="import">
5+
<script src="../../polymer/polymer.js"></script>
6+
</head>
7+
<body>
8+
<polymer-element name="libphonenumber-demo" noscript>
9+
<template>
10+
<libphonenumber-js phone="{{phone}}" valid="{{valid}}" formatted="{{formatted}}"></libphonenumber-js>
11+
<input value="{{phone}}"><br>
12+
<p>
13+
Valid: {{valid}}<br>
14+
Formatted: {{formatted}}
15+
</p>
16+
</template>
17+
</polymer-element>
18+
<libphonenumber-demo></libphonenumber-demo>
19+
</body>
20+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script src="libphonenumber.js"></script>
2+
<polymer-element name="libphonenumber-js" attributes="country phone valid formatted">
3+
<script>
4+
Polymer('libphonenumber-js', {
5+
country: 'US',
6+
valid: false,
7+
phoneChanged: function() {
8+
this.formatted = formatLocal(this.country, this.phone);
9+
this.valid = isValidNumber(this.country, this.phone);
10+
}
11+
});
12+
</script>
13+
</polymer-element>

0 commit comments

Comments
 (0)