'[오브젝트]'를 입력 할 양도 할 수 없습니다 :오류 TS2322 : 유형 '객체 []'나는 이런 코드가
export class TagCloud {
tags: [Tag];
locations: [Location];
constructor() {
this.tags = new Array<Tag>();
this.locations = new Array<Location>();
}
}
을하지만이 나에게 다음과 같은 오류가 있습니다 :
을오류 TS2322 : '태그 []'유형을 '[태그]'유형에 지정할 수 없습니다. '태그 []'유형에 '0'속성이 없습니다.
오류 TS2322 : 유형 '[Lo 양]]에'위치 [] '을 할당 할 수 없습니다. 'Location []'유형에 '0'속성이 없습니다.
무엇이 잘못 되었습니까 (코드는 작동합니까?).
es6-shim 유형 설명 (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/es6-shim)과 함께 타이핑을 사용하고 있습니다.