October 2017
Intermediate to advanced
370 pages
8h 57m
English
Now that we have an amp-list to fetch the JSON data that represents the cart contents, we need to write the mustache template next. In the last chapter we used an amp-mustache template in the amp-form submit-success container to handle the response from the server when we added an item to the cart. It would be great if we could use this template again.
Since we built the cart server endpoint to return JSON data similar to when adding a product, that is, the cart contents, then we should be able to re-use the add-to-cart template. So, how can we share the template between the amp-list and the amp-form?
Read now
Unlock full access