InstantSearch / Angular / V4 / API reference

Ais-Clear-Refinements | 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-clear-refinements
  // Optional parameters
  [includedAttributes]="string[]"
  [excludedAttributes]="string[]"
  [autoHideContainer]="boolean"
></ais-clear-refinements>

Import

1
2
3
4
5
6
7
8
import { NgAisClearRefinementsModule } from 'angular-instantsearch';

@NgModule({
  imports: [
    NgAisClearRefinementsModule,
  ],
})
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-clear-refinements widget displays a button that lets users clear every refinement applied to the search.

Examples

1
<ais-clear-refinements></ais-clear-refinements>

Props

excludedAttributes

Optional
Type: string[]

The attributes to exclude from the refinements to clear. In the example below, the attribute brand is excluded from the refinements to clear.

1
2
3
<ais-clear-refinements
  [excludedAttributes]="['brand']"
></ais-clear-refinements>

includedAttributes

Optional
Type: string[]

The attributes to include in the refinements to clear (all by default). In the example below, only the query and categories attributes are included in the refinements to clear.

1
2
3
<ais-clear-refinements
  [includedAttributes]=['query', 'categories']
></ais-clear-refinements>

autoHideContainer

Optional
Type: boolean

Hides the widget if there’s no refinements to display

1
2
3
<ais-clear-refinements
  [autoHideContainer]="true"
></ais-clear-refinements>
Did you find this page helpful?