I'm struggling to implement a API call on a page and was wondering where I am going wrong with the Subscribe/Observe method, right now I have the following code:
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);
}
}
But there is nothing in the Console/Network areas of the page so it looks like no API is loading at all, can anyone help?