P
P
Partizanin2018-12-19 18:22:40
Angular
Partizanin, 2018-12-19 18:22:40

Angular 7 how to read response from server?

Hello, tell me why I can not read the response from the server?
I’m doing server side pagination, when requesting to the server, everything is processed well, for a start I decided to send a list of strings, angular got something but I can’t read it writes undefinde?
here is the query

return this.http.get(url, {
      params: new HttpParams()
        .set('fileId', fileId.toString())
        .set('filter', filter)
        .set('sortOrder', sortOrder)
        .set('pageNumber', pageNumber.toString())
        .set('pageSize', pageSize.toString())
    }).pipe(
      map(res => res['payload'])
    );

where i read the answer
this.coursesService.findSystemFiles(fileId, filter, sortDirection,
      pageIndex, pageSize).pipe(
      catchError(() => of([])),
      finalize(() => this.loadingSubject.next(false))
    )
      .subscribe(data =>{
        this.lessonsSubject.next(data);
        console.log(data)// пытаюсь прочитать ответ от сервера
      }) ;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question