如果我使用 express 和 angular,是否需要带有 inversify 的 reflect-metadata 包?
Do I need reflect-metadata package with inversify if I use express and angular?
反转文档说
The reflect-metadata polyfill should be imported only once in your entire application because the Reflect object is mean to be a global singleton. More details about this can be found here.
If your environment don't support one of these you will need to import a shim or polyfill
我正在为我的服务器使用 LTS node+express。最新的 angular 我的客户。
所以我假设:
- 我的服务器项目不需要它,因为 LTS 节点不需要这些垫片
- 我的客户项目不需要它,因为 angular 会自动捆绑各种 shim
对吗?什么时候需要那个包?
事实证明,如果没有这个 polyfill,它就无法在服务器上运行。似乎有必要让 inversify 工作,即使我使用的是最新的 LTS 节点。
反转文档说
The reflect-metadata polyfill should be imported only once in your entire application because the Reflect object is mean to be a global singleton. More details about this can be found here.
If your environment don't support one of these you will need to import a shim or polyfill
我正在为我的服务器使用 LTS node+express。最新的 angular 我的客户。
所以我假设:
- 我的服务器项目不需要它,因为 LTS 节点不需要这些垫片
- 我的客户项目不需要它,因为 angular 会自动捆绑各种 shim
对吗?什么时候需要那个包?
事实证明,如果没有这个 polyfill,它就无法在服务器上运行。似乎有必要让 inversify 工作,即使我使用的是最新的 LTS 节点。