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"])
); }