Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in PRIMER.md #1204

Merged
merged 1 commit into from
Feb 19, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PRIMER.md
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ To bind to properties, the binding annotation should be provided as the value to
</script>
```

As in the exmaple above, paths to object sub-properties may also be specified in templates. See [Binding to structured data](#path-binding) for details.
As in the example above, paths to object sub-properties may also be specified in templates. See [Binding to structured data](#path-binding) for details.

In order to bind to camel-case properties of elements, dash-case should be used in the attribute name. Example:

Expand All @@ -851,7 +851,7 @@ Note that currently binding to `style` is a special case which results in the va

Polymer supports cooperative two-way binding between elements, allowing elements that "produce" data or changes to data to propagate those changes upwards to hosts when desired.

When a Polymer elements changs a property that was "published" as part of its public API with the `notify` flag set to true, it automatically fires a non-bubbling DOM event to indicate those changes to interested hosts. These events follow a naming convention of `<property>-changed`, and contain a `value` property in the `event.detail` object indicating the new value.
When a Polymer elements changes a property that was "published" as part of its public API with the `notify` flag set to true, it automatically fires a non-bubbling DOM event to indicate those changes to interested hosts. These events follow a naming convention of `<property>-changed`, and contain a `value` property in the `event.detail` object indicating the new value.

As such, one could attach an `on-<property>-changed` listener to an element to be notified of changes to such properties, set the `event.detail.value` to a property on itself, and take necessary actions based on the new value. However, given this is a common pattern, bindings using "curly-braces" (e.g. `{{property}}`) will automatically perform this upwards binding automatically without the user needing to perform those tasks. This can be defeated by using "square-brace" syntax (e.g. `[[property]]`), which results in only one-way (downward) data-binding.

Expand Down Expand Up @@ -1064,7 +1064,7 @@ Polymer provides an alternate binding annotation syntax to make it explicit when
<!-- results in <my-element>.setAttribute('selected', this.value); -->

<!-- Property binding -->
<my-element selected="{{value}}></my-element>
<my-element selected="{{value}}"></my-element>
<!-- results in <my-element>.selected = this.value; -->

</template>
Expand Down