I am having trouble with implementing an API call on a page and I'm unsure about what's wrong with the Subscribe/Observe method. Currently, this is the code that I have:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { appRoutesNames } from 'src/app/app.routes.names';
import { coachInteractionRouteNames } from '../coach-integration.routes.names';
import { createSessionRouteNames } from '../create-session/create-session.routes.names';
import { coachMatchMakingRouteNames } from './coach-matchmaking.routes.names';
import { CoachGenericResponse,SupportAreaCategory } from './coach-matchmaking.model';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-coach-matchmaking',
templateUrl: './coach-matchmaking.component.html',
styleUrls: ['./coach-matchmaking.component.scss']
})
export class CoachMatchmakingComponent implements OnInit {
appService: any;
coachService: any;
supportAreas: any;
http: any;
constructor(private readonly router: Router, http: HttpClient) { }
ngOnInit(): void {
this.getCategories().subscribe;
}
//API Loading
private userAccessURL = "https://uks-tst-tbp-gw.azurewebsites.net/Business/GetCategories";
getCategories = () => {
return this.http.get(this.userAccessURL);
}
}
However, there doesn't seem to be anything showing up in the Console/Network sections of the page, indicating that the API is not loading at all. Can anyone provide some assistance?