DEV/ANGULAR
jhipster TS2559: Type 'typeof ' has no properties in common with type 'Component'. error 해결법
Guitaryc
2017. 7. 31. 15:13
반응형
문제
jhipster 를 최신버전으로 업그레이드 했더니 아래와 같은 에러가 난다..
jhipster에서 자동으로 만들어준부분인데 typescript버전 올라가면서 타입체크하는데서 에러가나는거 같다.
해결법
해당 에러 줄에 아래와같이 컴포넌트 클래스 이름뒤에 as Component를 붙여준다.
ngOnInit() {
this.routeSub = this.route.params.subscribe((params) => {
if ( params['id'] ) {
this.modalRef = this.resourcePopupService
.open(ResourceBlockChainInfoDialogComponent as Component, params['id']);
} else {
this.modalRef = this.resourcePopupService
.open(ResourceBlockChainInfoDialogComponent as Component);
}
});
}
반응형