Hi, 
Learning and practicing MEAN for couple weeks now and was able to make http 
get request api. 

My Angular front end has button and onclick it calls method angular 
component  -> then service ( all in TS). Service calls express backend to 
return json data.

Calls sequence & results in same order -->
Angular html page ( button + table of results returned by button click) -> 
Angular component TS -> Angular Service TS ( http get to express backend 
here) -> Express Router (Promise End http request to external server)


Angular http request is very simple and not using any fancy apis :
http.get(url).subscribe();

Express usings promise/then and http.request(options, function(res){})

Now, console.log at each level, I noticed that on first button click, my 
json at component level ( returned by service later)  is null and thus 
first button click, results are not displayed on page. Second click, it 
works. 

Why is that so? and do I need to introduce Observables here in Angular 
Service ?

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" 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.

Reply via email to