@Injectable()
/***
* Profile Management Service
*/
export class ManageProfileService {
private userDetails: any = null;
public getUserDetails$: Observable<any>
}
I am attempting to subscribe to the GetUserDetails Observable from this service. My goal is for it to return the value of UserDetails if it is not null. If UserDetails is null, I want it to call an HTTP service called "getUserDetails" and return the data received. If the HTTP service request fails, I need it to return null. Any guidance on how to achieve this would be greatly appreciated.