history
You are reading the documentation for Angular InstantSearch v3, which is in beta. You can find the v2 documentation here.
history({ // Optional parameters windowTitle: function, createURL: function, parseURL: function, writeDelay: number, });
About this widget
The history
router is the one used by default within ais-instantsearch
.
The router provides an API that lets you customize some of its behaviors. To get a sense of what you can do with the API, checkout our dedicated guide on Routing URLs.
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { history } from 'instantsearch.js/es/lib/routers';
@Component({
template: `
<ais-instantsearch [config]="config">
<!-- Widgets -->
</ais-instantsearch>
`
})
export class AppComponent {
config = {
// ...
routing: {
router: history()
}
};
}
Options
windowTitle
|
type: function
Optional
This function lets you dynamically customize the window title based on the provided |
||
Copy
|
|||
createURL
|
type: function
Optional
This function lets you directly change the format of URLs that are created and rendered for the browser URL bar or widgets. It’s called every time
|
||
Copy
|
|||
parseURL
|
type: function
Optional
This function is responsible for parsing the URL string back into a
|
||
Copy
|
|||
writeDelay
|
type: number
default: 400
Optional
This option controls the number of milliseconds the router waits before writing the new URL to the browser. You can think about it this way: “400ms after the last user action, the URL is pushed to the browser”. This helps reduce:
400ms is a typically a pretty good |
||
Copy
|