You are reading the documentation for Angular InstantSearch v3, which is in beta. You can find the v2 documentation here.
<ais-instantsearch [config]="{ indexName: string searchClient: object // Optional parameters numberLocale: string searchFunction: function routing: boolean|object }" ></ais-instantsearch>
About this widget #
The ais-instantsearch
widget is a wrapper that lets you configure the credentials for search. This component automatically provides the search state to all its children.
Note that every other Angular InstantSearch widgets must be wrapped under this one.
Examples #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import * as algoliasearch from 'algoliasearch/lite';
@Component({
template: `
<ais-instantsearch [config]="config">
<!-- Widgets -->
</ais-instantsearch>
`,
})
export class AppComponent {
config = {
indexName: 'instant_search',
searchClient: algoliasearch('AJ0P3S7DWQ', '90dfaaf5755e694f341fe68f6e41a6d4'),
}
}
Props #
indexName
# |
type: string
Required
The main index to search into. |
||
Edit
Copy
|
|||
searchClient
# |
type: object
Required
Provides a search client to |
||
Edit
Copy
|
|||
numberLocale
# |
type: string
Optional
The locale used to display numbers. This is passed to |
||
Edit
Copy
|
|||
searchFunction
# |
type: function
Optional
A hook that is called each time a search needs to be done, with the helper as a parameter. It’s your responsibility to call |
||
Edit
Copy
|
|||
routing
# |
type: boolean|object
default: true
Optional
Enables the default routing feature by passing |
||
Edit
Copy
|
HTML output#
1
2
3
<div class="ais-InstantSearch">
<!-- Widgets -->
</div>