내 서비스에서 페이지가 매겨진 결과를 반환 한 다음 코드를 가지고 있습니다. 난 그냥 각 5로 전환하고 이제 코드가 더 이상 내가 5 각도에서각도 5의 서비스에서 페이지가 매겨진 결과를 반환 할 수 없습니다.
Type 'Promise<any>' is not assignable to type 'IUser[]'
내 서비스에서 페이지가 매겨진 결과를 반환 한 다음 코드를 가지고 있습니다. 난 그냥 각 5로 전환하고 이제 코드가 더 이상 내가 5 각도에서각도 5의 서비스에서 페이지가 매겨진 결과를 반환 할 수 없습니다.
Type 'Promise<any>' is not assignable to type 'IUser[]'
, 당신은 더 이상 JSON에 매핑 할 필요가 없습니다 다음과 같은 오류 메시지를받을
return this._http.get(
this.userManagerResourceApiUrl + "GetAllUsers/" + tierID + "/" + countryID + "/" + officeID + "/" + filter
).map((res: Response) => {
paginatedResult.result = res.json();
if (res.headers.get("Pagination") != null) {
var paginationHeader: Pagination = this.itemsService.getSerialized<Pagination>(JSON.parse(res.headers.get("Pagination")));
paginatedResult.pagination = paginationHeader;
}
this.totalItems = paginatedResult.pagination.TotalItems;
return paginatedResult;
}).catch(this.handleError);
를 작동하지 않고 더 이상 필요하지 않은 map(res => res.json())
통화를 삭제하십시오. 어떤 라인에서이 오류가 발생하는 각도 5. https://onlyforcoder.blogspot.in/2017/11/angular-5-upgrade-your-project-To-Angular5.html
고맙습니다. –
에 프로젝트를 업그레이드하는 동안
상황이 돌봐? 이 줄의 –
"paginatedResult.result = res.json();" –