namespaceml-facets
Source: directives/
angular element directive; displays facets.
attributes:
facets
: thefacets
property of a search results object from MLSearchContext#search. (ctrl.response.facets
on MLSearchController)toggle
: A function to select/clear facets. Should invokemlSearch.toggleFacet(facetName, value).search()
. (MLSearchController#toggleFacet)negate
: optional. A function to negate/clear facets. Should invokemlSearch.toggleNegatedFacet(facetName, value).search()
. (MLSearchController#toggleNegatedFacet)showMore
: optional. A function get the nextn
(default5
) facets values. Should invokemlSearch.showMoreFacets(facet, facetName)
. (MLSearchController#showMoreFacets)template
: optional. A URL referencing a template to be used with the directive. If empty, the default bootstrap template will be used (chiclet-style facets). If"inline"
, a bootstrap/font-awesome template will be used (inline facet selections)truncate
: optional. The length at which to truncate the facet display. Defaults to20
.
Example:
<ml-facets facets="ctrl.response.facets" toggle="ctrl.toggleFacet(facet, value)" show-more="ctrl.showMoreFacets(facet, facetName)"></ml-facets>