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

Commit 1ef882c

Browse files
committed
chore(examples): Add a PolymerJS paper component using attribute mappings
1 parent 4081188 commit 1ef882c

File tree

5 files changed

+72
-0
lines changed

5 files changed

+72
-0
lines changed

example/bower.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "paper-example",
3+
"version": "0.0.1",
4+
"homepage": "https://github.com/angular/angular.dart",
5+
"authors": [
6+
"James deBoer <[email protected]>"
7+
],
8+
"description": "Paper with AngularDart",
9+
"main": "web/index.html",
10+
"license": "MIT",
11+
"private": true,
12+
"ignore": [
13+
"**/.*",
14+
"node_modules",
15+
"bower_components",
16+
"test",
17+
"tests"
18+
],
19+
"dependencies": {
20+
"polymer": "Polymer/polymer#~0.3.4",
21+
"paper-elements": "Polymer/paper-elements#~0.3.4",
22+
"core-elements": "Polymer/core-elements#~0.3.4"
23+
}
24+
}

example/web/bower_components

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../bower_components/

example/web/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<li><a href="hello_world.html">hello_world.html</a></li>
77
<li><a href="todo.html">todo.html</a></li>
88
<li><a href="shadow_dom_components.html">shadow_dom_components.html</a></li>
9+
<li><a href="paper_progress.html">paper_progress.html</a></li>
910
</ul>
1011
</body>
1112
</html>

example/web/paper_progress.dart

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:angular/angular.dart';
2+
import 'package:angular/application_factory.dart';
3+
4+
5+
main() {
6+
var injector = applicationFactory()
7+
.run();
8+
var scope = injector.get(Scope);
9+
scope.context['text'] = "Hello future";
10+
scope.context['max'] = 20;
11+
scope.context['curValue'] = 12;
12+
scope.apply();
13+
}

example/web/paper_progress.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport"
5+
content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
6+
7+
<!-- 1. Load platform.js for polyfill support. -->
8+
<script src="bower_components/platform/platform.js"></script>
9+
10+
<!-- 2. Use an HTML Import to bring in the element. -->
11+
<link rel="import"
12+
href="bower_components/paper-progress/paper-progress.html">
13+
<script type="application/dart" src="paper_progress.dart"></script>
14+
<script src="packages/browser/dart.js"></script>
15+
</head>
16+
<body>
17+
<h2>A quick demo of the Polymer paper-progress widget in an AngularDart app.</h2>
18+
<p>The max ({{max}}) and value ({{curValue}}) properties are bound through attribute intropolation</p>
19+
20+
<p>Text from Angular: <b>{{text}}</b></p>
21+
22+
<div>
23+
<paper-progress max={{max}} value={{curValue}}></paper-progress>
24+
</div>
25+
26+
<p>
27+
<label>
28+
Change the value through an ng-model bound input box:
29+
<input type="text" ng-model="curValue">
30+
</label>
31+
</p>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)