import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import * as i0 from "@angular/core";
/**
 * Manager of relations metadata
 */
export class RelationsManager {
    constructor() {
        //######################### protected fields #########################
        /**
         * Current relations value
         */
        this._relations = [];
        /**
         * Used for emitting relations changes
         */
        this._relationsChange = new Subject();
    }
    //######################### public properties #########################
    /**
     * Gets current relations value
     */
    get relations() {
        return this._relations;
    }
    /**
     * Occurs when relations changes
     */
    get relationsChange() {
        return this._relationsChange.asObservable();
    }
    //######################### public methods #########################
    /**
     * Sets relations new value
     * @param relations - Value of relations that changed
     */
    setRelations(relations) {
        if (this._relations == relations) {
            return;
        }
        this._relations = relations;
        this._relationsChange.next();
    }
}
RelationsManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: RelationsManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
RelationsManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: RelationsManager });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: RelationsManager, decorators: [{
            type: Injectable
        }] });
//# sourceMappingURL=relationsManager.service.js.map