I want to store data from an API call in a variable and then use it out of the subscription.
GetAges(): Observable<string[]> {
var url = this.SharedURL + '/ageGroupLocal?lang=' + this.lang;
return this.http.get<string[]>(url);
};
This is my service and I want to store the response in a variable and use it in a component.