File

app/core/services/filter-toggler/filter-toggle.service.ts

Description

Used for toggling filter view when hidden in mobile view

Index

Properties
Methods

Constructor

constructor()

Methods

Public closeFilters
closeFilters(id: string)
Parameters :
Name Type Optional
id string No
Returns : void
Public showFilters
showFilters(id: string)
Parameters :
Name Type Optional
id string No
Returns : void

Properties

facetState
Type : object
Default value : {}
filterState
Default value : this.filterTogglerSubject.asObservable()
Private filterTogglerSubject
Default value : new Subject<object>()
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

/**
 * 	Used for toggling filter view when hidden in mobile view
 */
@Injectable()
export class FilterToggleService {
	private filterTogglerSubject = new Subject<object>();
	filterState = this.filterTogglerSubject.asObservable();

	facetState = {};

	constructor() { }

	public showFilters(id: string) {
		this.facetState[id] = true;
		this.filterTogglerSubject.next(this.facetState);
	}
	public closeFilters(id: string) {
		this.facetState[id] = false;
		this.filterTogglerSubject.next(this.facetState);
	}
}

result-matching ""

    No results matching ""