We are new to angular and we are having few methods needs to be invoked in sequence and return a value. Here the return is invoking before completing the execution. I have tried different things like async await, promise, setTimeout but no luck. Is there any solution to work this in sync order in angular
transform(input:any)
{
this.getCachedUsers(); // this will set the this.CachedUsers array using a http get call(subscribe)
this.getUserFromCachedUsers(input); // this will set the this.userName based on input userId from this.CachedUsers
return this.userName; // here its returning empty
}