Answer the question
In order to leave comments, you need to log in
How to make a data guide?
Now a service has been written that has one method that returns directories with data:
@Injectable()
export class InteragencyCooperationReferencies {
public doctypes: ReplaySubject<any> = new ReplaySubject(1);
public results: ReplaySubject<any> = new ReplaySubject(1);
public reqtypes: ReplaySubject<any> = new ReplaySubject(1);
public status: ReplaySubject<any> = new ReplaySubject(1);
constructor(private interagencyCooperationService: InteragencyCooperationService) {
this.interagencyCooperationService.catalogsInterdepartInteraction().subscribe((response) => {
this.doctypes.next(response.doctypes);
this.results.next(response.results);
this.reqtypes.next(response.reqtypes);
});
}
}
Answer the question
In order to leave comments, you need to log in
It will be right
private response = this.interagencyCooperationService.catalogsInterdepartInteraction()
.pipe(shareReplay(1));
public doctypes = this.response.pipe(map(r => r.doctypes));
public results = this.response.pipe(map(r => r.results));
public reqtypes = this.response.pipe(map(r => r.reqtypes));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question