Angular Http - toPromise or subscribe

前端 未结 3 1882
走了就别回头了
走了就别回头了 2021-02-03 23:11

I have watch a few courses on Angular and have found there are different ways to manage data from an Http request.

  • Using Observables, .map(), .s
3条回答
  •  醉话见心
    2021-02-03 23:39

    I think as long as the response is not a data stream that you're going to use, then you'd better use the .toPromise() approach, because it's meaningless to keep listening to a response that you don't need and it's not even going to change.

提交回复
热议问题