Guest User

Guest User

  • Tech Writer
  • 189
  • 24.7k

I am having trouble binding data into a table in Angular

Jun 21 2022 7:42 AM

getUserDetailsList() {

  debugger;

post(this.baseURL +'/getUserDetailsList',this.errorHandler)

  .toPromise()

  .then(res =>this.list = res as UserDetails[]);

}

errorHandler(error: { error: { message: string; }; status: any; message: any; }) {

  let errorMessage = '';

  if(error.error instanceof ErrorEvent) {

    errorMessage = error.error.message;

  } else {

    errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`;

  }

  return throwError(errorMessage);

}

}


Answers (2)