我不会将来自 api 调用的数据存储在变量中并在订阅之外使用它
GetAges(): Observable<string[]> { var url = this.SharedURL + '/ageGroupLocal?lang=' + this.lang; return this.http.get<string[]>(url); };
这是我的服务,我想在变量中存储响应并在 component.ts 中使用它