본문 바로가기

DEV/ANGULAR

angular httpclient 에러메세지가 null 일때 해결법 response error null angular 버전을 4.3때로 올리고 HttpClient 를 이용하여 Angular api 에 나온대로 해서 error 작업을 하던중 원하던대로 body의 error메세지가 찍히지 않고 null 이 찍힌다. 좀 알아보니 text로 서버에서 리턴한경우는 리턴타입을 아래와 같이 명시해줘야 error메세지에 찍힌다.. save(account: any): Observable { return this.http.post('api/register', account, { responseType: 'text' }); } this.registerService.save(register.value).subscribe(() => { this.success = true; }, (response) => this.processEr.. 더보기
파이프에 파라미터로 객체 넘길때 에러 Parser Error: Missing expected } at the end of the expression Angular에 파이프를 만들어서 객체를 넘겼는데 }를 빼먹었따고 아래와 같이 에러가 난다. Parser Error: Missing expected } at the end of the expression 코드 {{coinRow?.coins.dash.price|currencyExchange:{myCurrency:myCurrency,currency:coinRow?.coins.currencies,exchangeRate:exchangeRate}}} Angular github 이슈에 보니 이미 올라온 이슈 . 해결법은 아래와같이 뒤에 객체와 칸을 뛰어준다. {{coinRow?.coins.dash.price|currencyExchange:{myCurrency:myCurrency,currency:coinRow?.co.. 더보기
jhipster TS2559: Type 'typeof ' has no properties in common with type 'Component'. error 해결법 문제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 = th.. 더보기