Skip to content

Instantly share code, notes, and snippets.

@sanjsanj
Created June 3, 2018 17:01
Show Gist options
  • Save sanjsanj/9540d9da5a1a4c06ef3d5b1415ad3b43 to your computer and use it in GitHub Desktop.
Save sanjsanj/9540d9da5a1a4c06ef3d5b1415ad3b43 to your computer and use it in GitHub Desktop.
<amp-list src="https://swapi.co/api/people/?format=json" items="results" height="800">
<template type="amp-mustache">
<div class="grey">
<h2>{{name}}</h2>
<!-- #variable is a value so its treated as a conditional -->
{{#url}}
<a href="{{url}}">Read more</a>
{{/url}}
<!-- #variable is an array so we loop over it -->
{{#films}}
<amp-list src="{{.}}?format=json" height="20" items="." single-item>
<template type="amp-mustache">
{{title}}
</template>
</amp-list>
{{/films}}
</div>
</template>
</amp-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment