(Angular) 我应该将我的 http 服务放在核心文件夹中(作为单例)还是放在延迟加载的模块本身中?

(Angular) Should I have my http services in core folder (as singleton) or in lazy loaded modules itself?

(Angular) 我应该将我的 http 服务放在核心文件夹中(作为单例)还是放在延迟加载的模块本身中?

哪种方法更好?

随着 Injectable decorator 的新 providedIn 属性(自 Angular v6)。无需在模块 AT ALL.

中注册服务