How using services with HTTP methods in Angular v17?

263 Views Asked by At

I'm trying to use a basic service that gets data from an API, using HttpClient module, but always it appears the error: the error on the browser, I think it looks clearer than on the console

This is my AppComponent.ts app.component.ts

This is the component where I want to use the data and show it home.component.ts

I think that not understanding Standalone components very well is what is causing the error.

If somebody can help me I appreciate a lot

I've tried creating a app.module.ts file but that leads me to another error cause Angular 17 works with standalone components. I don't know, I think that cause I'm new to all of this

0

There are 0 best solutions below