Thanks Sander. This clarifies things for me. However, what would be a work around? http get returns an observable, is there a way that I can have it instantly detect the changes rather than wait for the next cycle?
On Monday, November 21, 2016 at 10:15:11 AM UTC-5, Sander Elias wrote: > > Hi Mahmoud, > > Because your service is async. This means that it returns a promise. a > promise will not be resolved right away, but on the at first, next cycle. > that means that: > > this.eventService.getEvents(lat, lon, range, s).then(events => > this.eventsList > = events /*<== this runs in the future */ ); > console.log(this.eventsList);// <== this will run before the promise is > settled. > > Regards > Sander > -- You received this message because you are subscribed to the Google Groups "Angular" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
