नहीं मिला मैं इस उदाहरण के लिए इस मुद्दे को कम:निर्यात नहीं कर सकते आयात इंटरफ़ेस - निर्यात
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
नहीं है यह पहले से ही यहाँ जवाब? http://stackoverflow.com/questions/30270084/why-the-limitation-on-exporting-an-interface-by-default-in-typescript –
मुझे ऐसा नहीं लगता - यह समस्या डिफ़ॉल्ट निर्यात के साथ सौदा करती है जो मैं नहीं करता उपयोग नहीं करते हैं। फिर भी धन्यवाद। – user2878850
आह क्षमा करें, ठीक से पढ़ा नहीं गया –