如果服务器请求仅在组件中使用,我应该使用服务吗?

Should I use service if a server request is only used in a component?

在 angular Tour of Heroes App tutorial 中,他们使用服务来获取服务器端数据。两个组件将使用该服务来获取数据。

是不是因为服务器请求所以他们使用服务?还是因为该功能将在多个组件中使用?

如果服务器请求只会在一个组件中使用,我还应该使用服务吗?或者只是从组件的 .ts class 发送请求?哪个是最佳做法?

来自Angular's documentation

Components shouldn't fetch or save data directly and they certainly shouldn't knowingly present fake data. They should focus on presenting data and delegate data access to a service.