Angular - Advanced Patterns
Identify the error in this facade service method:
fetchData() {
this.apiService.getData().subscribe(data => {
this.data = data;
});
return this.data;
}Identify the error in this facade service method:
fetchData() {
this.apiService.getData().subscribe(data => {
this.data = data;
});
return this.data;
}this.data is not set immediately.this.data immediately, likely undefined before data arrives.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions