ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[ToastrService]: StaticInjectorError(Platform: core)[ToastrService]: NullInjectorError: No provider for ToastrService! NullInjectorError: StaticInjectorError(AppModule)[ToastrService]: StaticInjectorError(Platform: core)[ToastrService]: NullInjectorError: No provider for ToastrService! at NullInjector.get (core.js:855) at resolveToken (core.js:17514) at tryResolveToken (core.js:17440) at StaticInjector.get (core.js:17266) at resolveToken (core.js:17514) at tryResolveToken (core.js:17440) at StaticInjector.get (core.js:17266) at resolveNgModuleDep (core.js:30393) at NgModuleRef_.get (core.js:31578) at injectInjectorOnly (core.js:734) at resolvePromise (zone-evergreen.js:797) at resolvePromise (zone-evergreen.js:754) at zone-evergreen.js:858 at ZoneDelegate.invokeTask (zone-evergreen.js:391) at Object.onInvokeTask (core.js:39680) at ZoneDelegate.invokeTask (zone-evergreen.js:390) at Zone.runTask (zone-evergreen.js:168) at drainMicroTaskQueue (zone-evergreen.js:559) at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:469) at invokeTask (zone-evergreen.js:1603)
i am using ngx toastr in angular 8 its showing below error if anyone knowns the solution tell me
1k views Asked by praveen sunagar At
2
There are 2 answers
0
On
You are most likely using the wrong version of ngx-toastr for your version of angular. Check which version is compatible here https://github.com/scttcper/ngx-toastr#dependencies
Import
ToastrModule
in your AppModule: