Answer the question
In order to leave comments, you need to log in
Getting data asynchronously?
The service has a variable: private layers = [];
Which is filled statically in the service constructor:
constructor() {
this.layers.push({id: 1});
}
public load() {
return this.http.load();
}
this.layers.push()
? this.layers.
from the service from asynchronous filling and synchronous. let a = [];
a.push(1);
setTimeout(() => a.push(4), 5000);
console.log(a);
// В компоненте получить полный a[1, 4]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question