Injector Error: R3InjectorError(Standalone[_AppComponent])[_WebService -> _WebService -> _WebService]:

I'm a student so apologies for any incorrect termonology or my lack of understanding.

Im creating an Angular front-end to interact with my back end API. I am currently getting the following error in the console of the web page (inspect -> console). Injection Error Console:

As far as I know, my classes and files are set up perfectly fine. I will provide the relevent code below:


import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

export class WebService {

  beer_list: any;

  constructor(private http: HttpClient) { }

  getBeers() {
    return this.http.get(
        .subscribe((response: any) => {
            this.beer_list = response;



import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';
import { BeersComponent } from './beers.component';
import { WebService } from './web.service';
import { HttpClientModule } from '@angular/common/http';

  declarations: [
    AppComponent, BeersComponent
  imports: [
    BrowserModule, HttpClientModule
  providers: [WebService],
  bootstrap: [AppComponent]
export class AppModule { }


import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterOutlet } from '@angular/router';
import { WebService } from './web.service';

  selector: 'beers',
  standalone: true,
  imports: [CommonModule, RouterOutlet],
  templateUrl: './beers.component.html',
  styleUrls: ['./beers.component.css']

export class BeersComponent{

  beer_list: any;

  constructor(public webService: WebService) { }

  ngOnInit() {


I have tried absolutely everything I can think of. I am also following a tutorial given by my tutor, and I have checked his code and compared it with mine, and I have everything exactly the same.


  • A description of what you have right now

    • component calls service
    • service calls http endpoint
    • http eventually returns a value, which is assigned to a local variable on the service
    • the variable on the component never gets the http contents

    Realizing that you are doing an exercise I'm being careful not to give you the answer directly. The above should point you in the right direction. Let me know if it needs more.