Chromium Code Reviews| 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..547298b7c42984ecc903952d329c9ca04f25283a 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 <head> 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`. |
|  |
| @@ -196,6 +193,22 @@ although you can. |
|  |
| +##Initializing Polymer {#initializing-polymer} |
| + |
| +The `main()` function for the stopwatch example, defined |
| +in `index.dart`, calls `initPolymer()` to initialize Polymer. |
|
Kathy Walrath
2013/10/30 17:00:50
index.dart or index.html? This is the only mention
|
| + |
| +{% prettify html %} |
| +import 'package:polymer/polymer.dart'; |
| + |
| +void main() { |
| + initPolymer(); |
|
sethladd
2013/10/30 17:02:14
According to Messerly, this isn't the best practic
|
| +} |
| +{% endprettify %} |
| + |
| +You can initialize Polymer using other techniques, |
| +but this is the most straightforward. |
|
Kathy Walrath
2013/10/30 17:00:50
what is "this"? calling initPolymer()? having the
|
| + |
| ##Instantiating a custom element {#instantiating} |
| To create an instance of a custom element, |
| @@ -314,7 +327,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—which is called when the element is inserted |
| into the DOM—to initialize the app. |
| @@ -329,8 +342,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 +351,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']; |