Stats
Description
The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server).
Code example
You can use the directive <ng-template></ng-template> to customize the output:
@Component({ selector: 'my-app', template: ` <ais-stats> <ng-template let-state="state"> {{state.nbHits}} results found in {{state.processingTimeMS}}ms. </ng-template> </ais-stats> ` }) export class AppComponent {}
The state object contains:
hitsPerPageThe maximum number of hits per page returned by AlgolianbHitsThe number of hits in the result setnbPagesThe number of pages computed for the result set.pageThe current page.processingTimeMSThe time taken to compute the results inside the Algolia engine.queryThe query used for the current search.