【发布时间】:2018-05-22 13:07:51
【问题描述】:
我建立了一个新的 Angular 5 项目,似乎 @Injectable 装饰器不起作用。我必须为构造函数的每个参数使用 @Inject 装饰器手动注入。 我将 Angular 5.0.5 与 TS 2.4.2 一起使用。 这是我的 tsconfig.json:
{ "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ] } }
我为此浪费了很多时间,我真的不明白会发生什么。 你知道这个问题吗?
【问题讨论】:
标签: angular typescript