This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
metadata-message.service.ts 890 B
Newer Older
Daniel Rainer's avatar
Daniel Rainer committed
// unused
/*
Daniel Rainer's avatar
Daniel Rainer committed
// The code in this file and the files using this file is partially taken from
// https://stackoverflow.com/questions/46487255/pass-observable-data-from-parent-component-to-a-child-component-created-with-com
import { Injectable } from '@angular/core';
import { Subject, Observable } from 'rxjs';
import { IMetadataSelection, MetadataSelection } from 'app/search/metadata/metadata-selection.component';
Daniel Rainer's avatar
Daniel Rainer committed

@Injectable()
Daniel Rainer's avatar
Daniel Rainer committed
export class MetadataMessageService {
  filterSelection$: Observable<IMetadataSelection>;
  private filterSelectionSubject: Subject<IMetadataSelection> = new Subject<IMetadataSelection>();
Daniel Rainer's avatar
Daniel Rainer committed

  constructor() {
    this.filterSelection$ = this.filterSelectionSubject.asObservable();
  }

  public updateFilterSelection(metadataCategory: string, value: string): void {
    this.filterSelectionSubject.next(new MetadataSelection(metadataCategory, value));
Daniel Rainer's avatar
Daniel Rainer committed
*/