Angular 7 TypeError: service.x is not a function

I made a routing service and want to inject it into my nav component. But when i call a method on it it throws TypeError: routingService.getRequestedPage is not a function. Yesterday I had a very similar problem with another service, unfortunately I forgot how I solved this. I generated the service it with the terminal.

src/app/nav/nav.component.ts constructor:

constructor(private templateService: TemplateService, private routingService: RoutingService) {
    this.getTemplates();
    if (this.routingService.getRequestedPage() === 'home') {
      this.showHome();
    }
  }

src/app/nav/nav.component.ts import:

import {RoutingService} from '../shared/routing.service';

src/app/shared/routing.service.ts:

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class RoutingService {

  private requestedPage: string;

  constructor() {
    this.requestedPage = 'home';
  }

  requestPage(page: string) {
    this.requestedPage = page;
  }

  getRequestedPage() {
    return this.requestedPage;
  }
}

Source: New feed