Add some informative usage notes to the README.
Showing
1 changed file
with
12 additions
and
0 deletions
... | @@ -104,6 +104,18 @@ So let's say we wanted a `data-color` binding that sets the element's colour. He | ... | @@ -104,6 +104,18 @@ So let's say we wanted a `data-color` binding that sets the element's colour. He |
104 | - data-*[attribute]* | 104 | - data-*[attribute]* |
105 | - data-on-*[event]* | 105 | - data-on-*[event]* |
106 | 106 | ||
107 | ## Usage Notes | ||
108 | |||
109 | #### Rivets.View and Rivets.Binding | ||
110 | |||
111 | The `rivets.bind` function returns a bound `Rivets.View` instance that you should hold on to for later. You may want to unbind it's listeners with `view.unbind()` and/or rebuild it's bindings with `view.build()`. You can also access the individual `Rivets.Binding` instances inside the view through `view.bindings` — this is useful for debugging purposes or if you want to unbind or manually set the value for certain bindings. | ||
112 | |||
113 | #### Iteration Binding | ||
114 | |||
115 | Even though a binding routine for `each-item` will likely be included in Rivets.js, you can use the `data-html` binding along with a set of formatters in the interim to do sorting and iterative rendering of collections (amongst other cool things). | ||
116 | |||
117 | <ul data-html="model.tags | sort | tagList"></ul> | ||
118 | |||
107 | ## Building and Testing | 119 | ## Building and Testing |
108 | 120 | ||
109 | Before proceeding, make sure to run `npm install` so that you have all the development dependencies. | 121 | Before proceeding, make sure to run `npm install` so that you have all the development dependencies. | ... | ... |
-
Please register or sign in to post a comment