2

How want to call a webservice using http.get on Angular 2 handle the result and response to my caller with the result.

Is it better to use callback or promise ?

Thanks!! I use to work in NodeJS and often use callbacks.

Charly berthet
  • 1,178
  • 5
  • 15
  • 31

1 Answers1

2

In NodeJS we do a Callback but in Angular 2 it's better to use Promise or Observable.

Check this post to choose between Promise and Observable: Angular - Promise vs Observable

Community
  • 1
  • 1
jordanchase
  • 86
  • 1
  • 5