1
|
import { Injectable } from '@angular/core';
|
2
|
import { SearchResponse } from '../../model/SearchResponse';
|
3
|
import { BehaviorSubject } from 'rxjs';
|
4
|
import { QueryService } from '../query.service';
|
5
|
|
6
|
/*@Injectable({
|
7
|
providedIn: 'root'
|
8
|
})*/
|
9
|
@Injectable()
|
10
|
export class DataHolderService {
|
11
|
private storage = new BehaviorSubject<SearchResponse>(null);
|
12
|
public storage$ = this.storage.asObservable();
|
13
|
|
14
|
public constructor(private queryService: QueryService) {
|
15
|
}
|
16
|
|
17
|
setData(data: SearchResponse) {
|
18
|
console.log(this.storage);
|
19
|
this.storage.next(data);
|
20
|
}
|
21
|
}
|