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) {
    if (this.routingService.getRequestedPage() === 'home') {

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

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


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

  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