Hi
I am getting below error in ANgular 17
NullInjectorError: NullInjectorError: No provider for _HtpClient!
at NullInjector.get (core.mjs:1654:27)
at R3Injector.get (core.mjs:3093:33)
at R3Injector.get (core.mjs:3093:33)
at injectInjectorOnly (core.mjs:1100:40)
at Module.??inject (core.mjs:1106:42)
at Object.MyApplicationService_Factory [as factory] (my-application.service.ts:9:34)
at core.mjs:3219:47
at runInInjectorProfilerContext (core.mjs:866:9)
at R3Injector.hydrate (core.mjs:3218:21)
at R3Injector.get (core.mjs:3082:33)
Thanks
Tahir AnsariPosted Jun 28, 2024, 3:34 PM
1) import the Http client Module
2) inject in constructor where you you want
constructor(private http: HttpClient) { }