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

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: arrr maties. 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..c93f9f4fbd3da49f13030e21ecea41cd937d01d5 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">
@@ -183,12 +183,16 @@ 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`
+import `package:polymer/init.dart` within a &lt;script&gt; tag
+in the &lt;head&gt; section.
+This script contains the `main()` function
+for the app and initializes Polymer.
+
+ ![Include the Polymer init script](images/init-script.png)
+
+* In the primary HTML file for your app,
+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)
@@ -314,7 +318,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 +333,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 +342,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