import { Component, OnInit }    from '@angular/core'

import { FacetService }         from '@k-services/svc.facet'

@Component({
    moduleId: module.id+ '',
    selector: 'facet',
    templateUrl: './tpl.facet.pug',
    providers: [FacetService]
})

export class FacetView {

    corrections = {};
    facets: any;
    products: any;

    constructor(
        private _facet: FacetService
    ) {

    }

    ngOnInit() {
        this._facet.getProductsResult().then(response => {
            this.products = response.result.products
        })
    }

    setFacets(value: any) {
        this.facets = value;
    }

    setCorrections(value: any) {
        this.corrections = value
    }
}