TypeScript 编译中缺少文件 custom.ts。请通过 'files' 或 'include' 属性 确保它在您的 tsconfig 中

File custom.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property

我正在用 .Net API Custom 编写 CURD Angular 5。现在我在 Angular 5 中的 class 模型自定义出现错误 这是消息错误 编译失败。

./src/app/model/customer.model.ts
Module build failed: Error: 
D:\Angular\Project\CustomerApp\CustomerApp\ClientApp\src\app\model\customer.model.ts is missing from 
the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' 
property.
at AngularCompilerPlugin.getCompiledFile 

这是我的文件tsconfig.app.json

{

"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}

我尝试编辑文件 tsConfig.app.json,在“exclude”中添加 src/**/*.ts:

{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []`enter code here`
},
"exclude": [
"test.ts",
"**/*.spec.ts",
"src/**/*.ts"
]
}

但是不工作。请帮助我!!!

第一,我的名字文件型号是customer.model.ts 并按以下方式导入组件:

import { Customer } from '../../model/customer.model';

然后我将文件模型的名称更改为 customer.ts 并导入组件更改为:

import { Customer } from '../../model/customer';

现在运行良好。