Merged
Conversation
ghost
reviewed
Jan 27, 2017
extensions/amp-bind/amp-bind.md
Outdated
| The **scope** is mutable implicit document state that binding expressions may reference. The scope may be initialized with a new AMP component `<amp-state>`. Changes to the scope happen through user actions, e.g. clicking a `<button>` or switching slides on an `<amp-carousel>`. | ||
|
|
||
| A **digest** is an evaluation of all binding expressions. Since scope is mutable and expressions can reference the scope, the evaluated result of expressions may change over time. Bound elements are updated as a result of a digest. | ||
| A data binding is a special attribute that links an element to a custom [expression](#expressions). Expressions may reference implicit mutable JSON state. When that state is changed, expressions |
ghost
reviewed
Jan 27, 2017
extensions/amp-bind/amp-bind.md
Outdated
| `amp-bind` expressions are JS-like with some important differences: | ||
|
|
||
| - Expressions only have access to the **scope**, not globals like `window` or `document` | ||
| - Expressions may only access JSON state in `<amp-state>` and that set by the `AMP.setState` action |
There was a problem hiding this comment.
This sentence is slightly confusing because of the "and that set by" - what is set by the action? Is it the expression or the state? I think it's the state, so consider rewriting it as follows:
Expressions may only access the JSON state specified in <amp-state>, and that state is set by the AMP.setState action.
Author
There was a problem hiding this comment.
Good point.
Simplified to "...may only access the implicit JSON state." I think this suffices since we describe what that state is and how to modify it above.
ghost
approved these changes
Jan 27, 2017
Author
|
Thanks Barb! |
jridgewell
pushed a commit
to jridgewell/amphtml
that referenced
this pull request
Jan 31, 2017
* update bind docs * barb's comments
torch2424
pushed a commit
to torch2424/amphtml
that referenced
this pull request
Feb 14, 2017
* update bind docs * barb's comments
mrjoro
pushed a commit
to mrjoro/amphtml
that referenced
this pull request
Apr 28, 2017
* update bind docs * barb's comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
amp-bind.mdto use less jargon and update supported bindable attributesamp-actions-and-events.mdwith new event data syntax,amp-statecomponent, andAMP.setStateaction/to @bpaduch /cc @ericlindley-g