Home > Net >  Is there anyway to console the value which is present inside here?
Is there anyway to console the value which is present inside here?

Time:11-22

Services.ts
I need to findout the data present inside this API.How do we console this one?

   findCourseCategories() {
      return this.http.get(`/api/course-categories`)
        .pipe(
          map(res => res["categories"])
        );
    }

CodePudding user response:

use the tap :

   import {  map,  tap} from 'rxjs';

findCourseCategories() {
          return this.http.get(`/api/course-categories`).pipe(
          tap(data => console.log('categories: ', JSON.stringify(data))),
       map(res => res["categories"])
        );  }
  • Related