I have been working on subscribing to two observables and storing the values in an array object. It seems to be functioning correctly, but I am encountering an issue where it iterates three times, which puzzles me. This is part of a service that is used to create a new service. The code snippet below illustrates my approach. Additionally, I am curious if it's possible to utilize promises instead of observables in Angular. Is there a way to convert the observable into a promise and resolve it once I receive the value? Any assistance provided would be greatly appreciated.
addEmployeeData() {
const employeeObservable = this.apiService.getEmployeeDataObservable();
employeeObservable.subscribe({
next: (res: any) => {
let employee = res;
const paramsObservable = this.apiService.getParamsObservable();
pageParamsObservable.subscribe({
next: (pageParams: any) => {