3
Q)如何在以下服務中使用以下接口模塊?角度2:如何導入/導出c#生成的模型
如果我有從C#生成以下模型:
declare module App.Core.Model {
interface Address extends App.Core.Model.BaseEntity {
addressLine1: string;
addressLine2: string;
addressLine3: string;
area: string;
countryCode: string;
name: string;
postcode: string;
town: string;
}
}
服務:
// these don't work, get "model.ts error is not a module"
import {Client} from '../interfaces/model';
import {AdminUser} from '../interfaces/model';
import {Building} from '../interfaces/model';
@Injectable()
export class AppService {
...
}
的文件都在:
- 應用程序/接口/模型。 ts
- app/services/service.ts
謝謝,我結束了剛剛清理生成的文件和導出所有interf因爲這成爲一種痛苦幹杯。 – Dave