@input上的Angular2接口不能与AoT一起使用

时间:2016-10-09 14:44:47

标签: angular ionic2 angular2-aot

我有一个界面:

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;时,没有任何问题。

有人知道如何在使用AoT时定义@Input的类型吗?

另见https://forum.ionicframework.com/t/interface-does-not-export-bundle-dev-failed/66225

0 个答案:

没有答案