0

我正在开发一个 Web 应用程序,为此,我制作了模型、json 文件、一个组件以及服务和模拟数据文件。然后我在 gateway-module.ts 中提供 DiagnosticsRepository、GatewayDiagnosticsRest、GatewayDiagnosticsService,然后在应用程序 mudule.ts 中进一步导入。但是当我运行代码时,我得到了错误。

src/app/gateway/gateway.module.ts(105,15) 中的错误:错误 TS2304:找不到名称“DiagnosticsRepository”。src/app/gateway/gateway.module.ts(105,37):错误 TS2304:找不到名称“DiagnosticsRest”。src/app/gateway/gateway.module.ts(105,53):错误 TS2304:找不到名称 'DiagnosticsService

'。

4

1 回答 1

0

当您导入某些内容以在源文件夹中开始导入时。

做这样的事情:

从'./shared/loadinginterceptor.service'导入{LoaderInterceptorService};

始终从您所在的地方导入到您想去的地方。不要从源文件夹显式启动。

于 2019-04-17T07:13:40.160 回答