Skip to content

Commit ecf73cc

Browse files
jbdeboerrkirov
authored andcommitted
docs(examples): Add a paper-input example
1 parent b0a2781 commit ecf73cc

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

example/web/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<li><a href="form.html">form.html</a></li>
1111
<li><a href="maps.html">maps.html</a></li>
1212
<li><a href="paper_radio_group.html">paper_radio_group.html</a></li>
13+
<li><a href="paper_input.html">paper_input.html</a></li>
1314
</ul>
1415
</body>
1516
</html>

example/web/paper_input.dart

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import 'package:angular/angular.dart';
2+
import 'package:angular/application_factory.dart';
3+
4+
import 'dart:html';
5+
6+
@Decorator(
7+
selector: 'paper-input',
8+
updateBoundElementPropertiesOnEvents: const ['change', 'input']
9+
)
10+
class PaperInputBindings {}
11+
12+
13+
main() {
14+
applicationFactory()
15+
.addModule(new Module()
16+
..bind(PaperInputBindings))
17+
.run();
18+
}

example/web/paper_input.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Paper input example</title>
5+
<!-- 0. bower install; pub serve -->
6+
<!-- 1. Load platform.js for polyfill support. -->
7+
<script src="bower_components/platform/platform.js"></script>
8+
9+
<!-- 2. Use an HTML Import to bring in the element. -->
10+
<link rel="import"
11+
href="bower_components/paper-input/paper-input.html">
12+
</head>
13+
<body>
14+
<paper-input bind-value="curValue" bind-input-value="curInputValue"></paper-input>
15+
<ul>
16+
<l1>value: {{curValue}}</li>
17+
<l1>inputValue: {{curInputValue}}</li>
18+
</ul>
19+
<script type="application/dart" src="paper_input.dart"></script>
20+
<script src="packages/browser/dart.js"></script>
21+
</body>
22+
</html>

0 commit comments

Comments
 (0)