October 2017
Intermediate to advanced
370 pages
8h 57m
English
Note also that, since we are now using amp-list to fetch the search results, we need to change the JSON structure of the results from what we had in Chapter 6 to be more like the structure we used in Chapter 7 to fetch related products. That is, we'll need to wrap the results in a single item array again, so that the JSON data will look like this (/ch8/search-results-sample.json):
{ "items":[ { "keywords":"tshirt", "results":[ { "name":"T-shirt: Super Pouvoir", "price":9.99, "color":"red", "description":"Super cool super power t-shirt", "image":"img\/tshirt-0-f-red-320.png" }, ... ] } ]}
The search results are displayed in the same amp-mustache template as before, so we won't repeat it here.
Read now
Unlock full access