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


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.


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.


What will i import to make HTTP get requests ?


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