Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1417)

Unified Diff: src/site/docs/tutorials/polymer-intro/index.markdown

Issue 51473002: update polymer related info to 0.8.7 (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/site/docs/tutorials/polymer-intro/images/template-code.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/site/docs/tutorials/polymer-intro/index.markdown
diff --git a/src/site/docs/tutorials/polymer-intro/index.markdown b/src/site/docs/tutorials/polymer-intro/index.markdown
index 40c355290f3923eb57a141b921b91ada7ef50905..8ce9224f7aed59a1ff3ebd72777a84f782e0a5f4 100644
--- a/src/site/docs/tutorials/polymer-intro/index.markdown
+++ b/src/site/docs/tutorials/polymer-intro/index.markdown
@@ -49,7 +49,7 @@ within semantically meaningful HTML.
<aside class="alert">
<strong>Version Note:</strong> The code sample and the content
of this tutorial are compatible with
-<a href="https://pub.dartlang.org/packages/polymer#versions">polymer.dart 0.8.1</a>.
+<a href="https://pub.dartlang.org/packages/polymer#versions">polymer.dart 0.8.7</a>.
</aside>
<aside class="alert alert-info">
@@ -66,6 +66,7 @@ is the Dart implementation of Polymer.
* [An example](#an-example)
* [Installing Polymer.dart](#getting-polymer-dart)
* [Including Polymer.dart in your application](#bootstrap)
+* [Initializing Polymer](#initializing-polymer)
* [Instantiating a custom element](#instantiating)
* [Defining a custom element](#define-element)
* [Providing a template for the custom element](#providing-a-template)
@@ -183,12 +184,8 @@ you need to include Polymer in both
the HTML side and the Dart side of your app.
* In the primary HTML file for your app,
-include `packages/polymer/boot.js`
+include the `packages/browser/dart.js` bootstrap script
in the &lt;head&gt; section.
-When using this script,
-you do not need to define a top-level `main()` function,
-although you can.
-**Note:** Use this script instead of `packages/browser/dart.js`.
![Include the Polymer bootstrap script](images/bootstrap-script.png)
@@ -196,6 +193,24 @@ although you can.
![Import the Polymer library](images/polymer-library.png)
+##Initializing Polymer {#initializing-polymer}
+
+The stopwatch example has a `main()` function
+that calls `initPolymer()` to initialize Polymer.
+The main function is included as an inline Dart script in the HTML file.
Kathy Walrath 2013/10/29 21:48:48 I had a little trouble parsing this sentence. Incl
+
+{% prettify html %}
+...
+<script type="application/dart">
+ import 'package:polymer/polymer.dart';
+
+ void main() {
+ initPolymer();
+ }
+</script>
+...
+{% endprettify %}
+
##Instantiating a custom element {#instantiating}
To create an instance of a custom element,
@@ -314,7 +329,7 @@ Any Dart class that backs a Polymer element must subclass PolymerElement.
The class can respond to life-cycle milestones
by overriding [life-cycle methods](#life-cycle-methods).
-For example, the TuteStopwatch class overrides the `inserted()`
+For example, the TuteStopwatch class overrides the `enteredView()`
method&mdash;which is called when the element is inserted
into the DOM&mdash;to initialize the app.
@@ -329,8 +344,8 @@ that it can override:
|---|---|
| `created()` | Called when an instance of a custom element is created. |
-| `inserted()` | Called when an instance of a custom element is inserted into the DOM. |
-| `removed()` | Called when an instance of a custom element is removed from the DOM. |
+| `enteredView()` | Called when an instance of a custom element is inserted into the DOM. |
+| `leftView()` | Called when an instance of a custom element is removed from the DOM. |
| `attributeChanged()` | Called when an attribute, such as `class`, of an instance of the custom element is added, changed, or removed. |
{: .table}
@@ -338,16 +353,16 @@ You can override any of these life-cycle methods.
The overriding method
*must* call the super class method first.
-The Stopwatch app overrides the `inserted()` method because it
+The Stopwatch app overrides the `enteredView()` method because it
needs a reference to each of the three buttons
so that it can enable and disable them.
When a tute-stopwatch custom element is inserted into the DOM
the buttons have been created, so the references to them
-will be available when the inserted() method is called.
+will be available when the enteredView() method is called.
{% prettify dart %}
-void inserted() {
- super.inserted();
+void enteredView() {
+ super.enteredView();
startButton = $['startButton'];
stopButton = $['stopButton'];
resetButton = $['resetButton'];
« no previous file with comments | « src/site/docs/tutorials/polymer-intro/images/template-code.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698