我有一个界面:
export interface IEvent {
name: string;
city: string;
startDate: Date;
endDate: Date;
}
我在课堂上使用的:
import {IEvent} from '../../interfaces/IEvent';
export class Event implements OnInit {
@Input() data: IEvent;
使用 AoT 编译时出现此错误:
Module src/interfaces/IEvent.ts does not export IEvent (imported by src/components/Event/Event.ts)
当我改变@Input
成@Input() data;
没有问题。
有谁知道@Input
在使用 AoT 时如何定义类型?
另请参阅https://forum.ionicframework.com/t/interface-does-not-export-bundle-dev-failed/66225