Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To remove filters set by 'filterBy,' we can simply set the filter criteria to an empty string or null value. For example:

this.filteredItems = this.items.filterBy('category', ''); // Removes the filter set for 'category'

Alternatively, we can also use the 'removeFilter' method provided by the Ember addon 'ember-composable-helpers' to remove a specific filter criteria. For example:

import { removeFilter } from 'ember-composable-helpers';

this.filteredItems = removeFilter(this.items, 'category'); // Removes the filter set for 'category'

Additionally, we can also use the 'clearFilters' method provided by the same addon to remove all filters set on the items array. For example:

import { clearFilters } from 'ember-composable-helpers';

this.filteredItems = clearFilters(this.items); // Removes all filters set on items array