【发布时间】:2017-04-12 00:26:17
【问题描述】:
我将问题简化为这个例子:
test.model.ts
export class A {
a: number;
}
export interface B {
b: number;
}
test.component.ts
import { Component, Input } from '@angular/core';
import { A, B } from './test.model';
@Component({
selector: 'test',
template: '<h1>test</h1>'
})
export class TestComponent {
//This works fine
@Input() foo: A;
//Does NOT work - export 'B' was not found in './test.model'
@Input() bar: B;
}
当我想使用界面时,我收到以下警告:
WARNING in ./src/app/.../test.component.ts
21:76 export 'B' was not found in './test.model'
但是,使用 类 是可以的。有什么提示吗?
更新:似乎与此问题有关:https://github.com/webpack/webpack/issues/2977
【问题讨论】:
-
这里不是已经回答了吗? stackoverflow.com/questions/30270084/…
-
我不这么认为 - 该问题涉及我不使用的默认导出。还是谢谢。
-
抱歉,没有正确阅读
-
这是运行时错误还是编译错误?
-
这是一个编译警告。
标签: angular typescript ecmascript-6