Skip to content

Instantly share code, notes, and snippets.

@cathyxz
Created April 24, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cathyxz/54faee538a7a9ee9375cfb07f92d7c9b to your computer and use it in GitHub Desktop.
Save cathyxz/54faee538a7a9ee9375cfb07f92d7c9b to your computer and use it in GitHub Desktop.
Single item list example
<amp-list class="i-amphtml-element i-amphtml-layout-fill i-amphtml-layout-size-defined i-amphtml-layout fill-list fill-list-show" [class]="searchState.inputValue == '' ? 'fill-list' : 'fill-list fill-list-show'" credentials="include" [src]="searchState.inputValue ? autosuggest.autoSuggestSearch + encodeURIComponent(searchState.inputValue) : autosuggest.emptyAndInitialTemplateJson" layout="fill" single-item="data" items="data" id="auto-prom-suggest" noloading="" i-amphtml-layout="fill" aria-live="polite" src="https://m.aliexpress.com/api/search/auto-suggests/dress">
<template type="amp-mustache">
<div class="s-seller">
{{#autoSuggestPromList}}
<a href="{{action}}&amp;spm=a2g0n.home-amp" class="auto">
<div class="prom flex align-center">
{{#icon}}
<amp-img src="{{icon}}" class="prom-image" alt="image" width="60" height="30" layout="fixed"></amp-img>
{{/icon}}
<span class="prom-txt">{{keyWord}}</span>
</div>
</a>
{{/autoSuggestPromList}}
</div>
<div class="s-cat">
{{#autoSuggestCatList}}
<a href="{{mainSearchURL}}&amp;channel=direct" class="auto-cat" data-amp-replace="QUERY_PARAM">
<div class="cat">
<div>
<div class="cate-txt">{{keyWord}}</div>
<span class="category">{{catName}}</span>
</div>
{{#keyWord}}
<div class="go-icon ic-md ic-insert-md"></div>
{{/keyWord}}
</div>
</a>
{{/autoSuggestCatList}}
</div>
<div class="s-item">
{{#autoSuggestList}}
<a href="{{mainSearchURL}}?channel=direct" data-amp-replace="QUERY_PARAM">
<div class="suggest">
<div class="txt-wrap">
<div class="sug-txt ellipsis">{{keyWord}}</div>
</div>
{{#keyWord}}<div class="go-icon ic-md ic-insert-md"></div>{{/keyWord}}
</div>
</a>
{{/autoSuggestList}}
</div>
</template>
</amp-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment