我把问题简化为这个例子:
原文链接:https://www.f2er.com/angularjs/141033.htmltest.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