K
K
kachurinets2018-08-06 14:19:33
Angular
kachurinets, 2018-08-06 14:19:33

How to make a query sequence in Angular?

ngOnInit() {
        this.addressesService.getRegions().subscribe((resp) => {
            this.regions = resp.data.items;
            this.loading = true;
        }, (error) => {
            console.log(error);
        });

        this.addressesService.getObj().subscribe((resp) => {
            this.district = resp.data;
        }, (error) => {
            console.log(error);
        });
// other code
}

How to make a sequence of requests, you need to make it so that only when the first request is executed, run the second one. How to do it using RxJs?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question