Update README with new dependency declaration syntax notes.
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -153,9 +153,11 @@ Just use `model:property` instead of `model.property` inside your binding declar | ... | @@ -153,9 +153,11 @@ Just use `model:property` instead of `model.property` inside your binding declar |
153 | Computed properties are functions that get re-evaluated when one or more dependent properties change. Declaring computed properties in Rivets.js is simple, just separate the function from it's dependencies with a *<*. The following `data-text` binding will get re-evaluated with `event.duration()` when either the event's `start` or `end` attribute changes. | 153 | Computed properties are functions that get re-evaluated when one or more dependent properties change. Declaring computed properties in Rivets.js is simple, just separate the function from it's dependencies with a *<*. The following `data-text` binding will get re-evaluated with `event.duration()` when either the event's `start` or `end` attribute changes. |
154 | 154 | ||
155 | ```html | 155 | ```html |
156 | <span data-text="event:duration < start end"></span> | 156 | <span data-text="event:duration < .start .end"></span> |
157 | ``` | 157 | ``` |
158 | 158 | ||
159 | The prepended `.` is a shorthand syntax for specifying dependencies that are the same object as the target object, so the above declaration is effectively the same as `event:duration < event.start event.end`. | ||
160 | |||
159 | #### Iteration Binding | 161 | #### Iteration Binding |
160 | 162 | ||
161 | Use the `data-each-[item]` binding to have Rivets.js automatically loop over items in an array and append bound instances of that element. Within that element you can bind to the iterated item as well as any contexts that are available in the parent view. | 163 | Use the `data-each-[item]` binding to have Rivets.js automatically loop over items in an array and append bound instances of that element. Within that element you can bind to the iterated item as well as any contexts that are available in the parent view. | ... | ... |
-
Please register or sign in to post a comment