Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: polymer_1.0.4/bower_components/iron-list/README.md

Issue 1264073002: Update polymer 1.0 install to pick up newly added elements. (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Update bower file to match actual versions. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/iron-list/README.md
diff --git a/polymer_1.0.4/bower_components/iron-list/README.md b/polymer_1.0.4/bower_components/iron-list/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..5f1846d7b01b955552e4858f296cb4201e9fd6e9
--- /dev/null
+++ b/polymer_1.0.4/bower_components/iron-list/README.md
@@ -0,0 +1,64 @@
+iron-list
+========================
+
+`iron-list` displays a virtual, *'infinite'* list. The template inside
+the iron-list element represents the DOM to create for each list item.
+The `items` property specifies an array of list item data.
+
+For performance reasons, not every item in the list is rendered at once;
+instead a small subset of actual template elements *(enough to fill the viewport)*
+are rendered and reused as the user scrolls. As such, it is important that all
+state of the list template be bound to the model driving it, since the view may
+be reused with a new model at any time. Particularly, any state that may change
+as the result of a user interaction with the list item must be bound to the model
+to avoid view state inconsistency.
+
+__Important:__ `iron-list` must ether be explicitly sized, or delegate scrolling to an
+explicitly sized parent. By "explicitly sized", we mean it either has an explicit
+CSS `height` property set via a class or inline style, or else is sized by other
+layout means (e.g. the `flex` or `fit` classes).
+
+### Template model
+
+List item templates should bind to template models of the following structure:
+
+```js
+{
+ index: 0, // data index for this item
+ item: { // user data corresponding to items[index]
+ /* user item data */
+ }
+}
+```
+
+Alternatively, you can change the property name used as data index by changing the
+`indexAs` property. The `as` property defines the name of the variable to add to the binding
+scope for the array.
+
+For example, given the following `data` array:
+
+##### data.json
+
+```js
+[
+ {"name": "Bob"},
+ {"name": "Tim"},
+ {"name": "Mike"}
+]
+```
+
+The following code would render the list (note the name and checked properties are
+bound from the model object provided to the template scope):
+
+```html
+<template is="dom-bind">
+ <iron-ajax url="data.json" last-response="{{data}}" auto></iron-ajax>
+ <iron-list items="[[data]]" as="item">
+ <template>
+ <div>
+ Name: <span>[[item.name]]</span>
+ </div>
+ </template>
+ </iron-list>
+</template>
+```
« no previous file with comments | « polymer_1.0.4/bower_components/iron-list/.gitignore ('k') | polymer_1.0.4/bower_components/iron-list/bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698