Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace incode.search.facets
- {
- export class MultiselectFacetController
- {
- public filterExpanded: boolean;
- public facet: IFacet;
- public clearAction: (facet: IFacet) => void;
- public applyAction: (facet: IFacet) => void;
- constructor() {
- console.log("made a multiselect facet");
- if (!this.facet || this.facet.Type != FacetType.Multiselect)
- {
- return;
- }
- }
- clearFilter()
- {
- if (this.clearAction)
- {
- this.clearAction(this.facet);
- }
- }
- applyFilter()
- {
- if (this.applyAction)
- {
- this.applyAction(this.facet);
- }
- }
- SelectedCount(): number {
- return (this.facet.Buckets && this.facet.Buckets.length) ? this.facet.Buckets.filter(x => x.Selected).length : 0;
- }
- FacetCount(): number {
- return (this.facet.Buckets && this.facet.Buckets.length) ? this.facet.Buckets.length : 0;
- }
- }
- export class MultiselectFacetComponent implements ng.IComponentOptions
- {
- public templateUrl: string;
- public controller: any;
- public controllerAs: string = "facetController";
- public transclude: boolean = true;
- bindings: { [binding: string]: string };
- constructor()
- {
- this.templateUrl = "../../library/incode/components/search/facets/multiselectFacet.tmpl.html";
- this.controller = MultiselectFacetController;
- this.bindings = {
- facet: "=",
- clearAction: "&",
- applyAction: "&",
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement