Unexpected value 'HttpClient' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation


#1

I am getting this error when i am importing “HttpClient” to app.module.ts

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

Please help me out of it.

Alternately, Please give me a ionic Sample project where HTTP GET request is properly demonstrated.


#2

I doubt that, because an import is not a declaration in a module. Your problem lies within the app module itself, not with the import.


#3

What will i import to make HTTP get requests ?


#4

You’re not listening either to me or the error message. This has nothing to do with imports.