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

Skip to content
Snippets Groups Projects
Commit 5f4386de authored by Daniel Rainer's avatar Daniel Rainer
Browse files

Pass value instead of frequency

When clicking a local filter item
only its value is interesting.
parent ccf08aeb
Branches
Tags
No related merge requests found
......@@ -2,7 +2,6 @@
// 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 { IFrequency } from 'app/shared/model/frequency.model';
import { IMetadataSelection, MetadataSelection } from 'app/search/metadata/metadata-selection.component';
@Injectable()
......@@ -14,7 +13,7 @@ export class MetadataMessageService {
this.filterSelection$ = this.filterSelectionSubject.asObservable();
}
public updateFilterSelection(metadataCategory: string, newSelection: IFrequency<string>): void {
this.filterSelectionSubject.next(new MetadataSelection(metadataCategory, newSelection.key));
public updateFilterSelection(metadataCategory: string, value: string): void {
this.filterSelectionSubject.next(new MetadataSelection(metadataCategory, value));
}
}
<div class="solid" [hidden]="frequencies == null">
<span class="meta" jhiTranslate="search.metadata.{{parameter}}">file format</span>
<li class="meta" *ngFor="let frequency of frequencies"
(click)="messageService.updateFilterSelection(parameter, frequency); toggleSelection(frequency.key)"
(click)="messageService.updateFilterSelection(parameter, frequency.key); toggleSelection(frequency.key)"
[style.background-color]="isSelected(frequency.key) ? 'rgba(0,255,0,0.5)' : 'rgba(0,0,0,0)'">
<div>
<a class="meta">{{frequency.key}}<span
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment