Back to Amphtml

amp

examples/bind/list.amp.html

latest1.2 KB
Original Source

setState() for amp-list[src]: Remote (URL)

Show FruitShow VegetablesShow Other Foods

setState() for amp-list[src]: Local (JSON)

Show Junk FoodShow DessertsAdd burger

setState() for children of amp-list

Increment foo


name {{name}} # {{quantity}} $ {{unitPrice}} 1+1 =? foo =?

amp-list:not([binding])

Expected: The same behavior as [binding=always].

(Placeholder)

amp-list[binding=always]

Expected: The "1+1" and "foo" items should be "2" and "bar" on page load, respectively.

(Placeholder)

amp-list[binding=refresh]

Expected: The "1+1" and "foo" items should be "?" on page load.

(Placeholder)

amp-list[binding=refresh-evaluate]

Expected: Tapping "Increment foo" should update "foo" items but _not_ the "1+1" items.

(Placeholder)

amp-list[binding=no]

Expected: Tapping "Increment foo" should have no effect.

(Placeholder)


Due to viewport position, this amp-list will be laid out after amp-bind's initial DOM scan.

  1. Scroll down so that this amp-list enters viewport and is laid out.
  2. Tap the "Increment foo" button.

Expected: The amp-list's children should update their "Foo:" values.

amp-list vs. amp-bind race condition test

(Placeholder)