InstantSearch
/
Angular
/
V4
/
API reference
Jan 16, 2025
Ais-Stats | Angular InstantSearch V4 (Deprecated)
Deprecated content
Angular InstantSearch is deprecated.
Please use InstantSearch.js instead. For more information, see Migrating from Angular InstantSearch.
Signature
Signature
<ais-stats></ais-stats>
Import
Copy
1
2
3
4
5
6
7
8
import { NgAisStatsModule } from 'angular-instantsearch';
@NgModule({
imports: [
NgAisStatsModule,
],
})
export class AppModule {}
1. Follow additional steps in Optimize build size to ensure your code is correctly bundled.
2. This imports all the widgets, even the ones you don’t use. Read the Getting started guide for more information.
About this widget
The ais-stats
component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server).
Examples
Copy
1
<ais-stats></ais-stats>
Props
state
Optional
Type:
object
hitsPerPage: number
: maximum number of hits returned per page.nbPages: number
: number of pages returned. Calculation is based on the total number of hits (nbHits
) divided by the number of hits per page (hitsPerPage
), rounded up to the nearest integer.nbHits: number
: number of hits matched by the query.page: number
: index of the current page (zero-based).processingTimeMS: number
: time the server took to process the request, in milliseconds. This does not include network time.query: string
: an echo of the query text.
Copy
1
2
3
4
5
<ais-stats>
<ng-template let-state="state">
{{state.nbHits}} results found in {{state.processingTimeMS}}ms.
</ng-template>
</ais-stats>
Did you find this page helpful?