Angular 2 HTTP “Cannot resolve all parameters for 'AppService'”

前端 未结 4 1379
梦毁少年i
梦毁少年i 2020-12-10 01:27

I tried to import the http provider into a service, but I\'m getting the following error:

Cannot resolve all parameters for \'AppService\'(?). Make su

4条回答
  •  被撕碎了的回忆
    2020-12-10 01:48

    Another way to do it, which saves some typing in the future would be:

    in your tsconfig.json add compilerOptions.emitDecoratorMetadata=true

    example of simple tsconfig.json would be:

    {
      "compilerOptions": {
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true
      }
    }
    

提交回复
热议问题