search:result-list

Description

The Result List directive.

Accessing result index

Within a search result you can access the index of the result by doing {{$parent.index}}. The index is zero-based so for result 1 the index will be 0.

Usage

as element:
<search:result-list
       response="{object}"
       results="{array}"
       [infinite-scroll="{boolean}"]
       [query="{string}"]
       [platform="{object}"]
       [load-more="{boolean}"]>
</search:result-list>

Directive info

  • This directive creates new scope.

Parameters

Param Type Details
response object

A response object (Use response or results not both)

results array

A list of results (Use response or results not both)

infinite-scroll
(optional)
boolean

Whether infinite scrolling should be enabled. Options are "window" or "parent". Window: when the window is scrolled to the bottom of the result list new results will be loaded. Parent: when the parent element is scrollable when this element is scrolled to the bottom new results will load. Default:"window".

query
(optional)
string

The name of the query object used for infinite scrolling or load more.

platform
(optional)
object

The platform object used for infinite scrolling or load more.

load-more
(optional)
boolean

Whether to have a clickable link to load more results.

Example

Source





Demo