Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[Table -> FilterService]:

UI Components for Angular
Post Reply
vineetpa
Posts: 1
Joined: 31 Dec 2020, 06:56

31 Dec 2020, 07:00

Hi,

I am trying to implement PRIMENG TABLE in my angular app and am following the same steps as mentioned in https://primefaces.org/primeng/showcase/#/table/filter.

I have specified the TableModule in app.module file as well and have also included the provider in my component, but still I am getting this error. Could anyone help me out here as I have been stuck from last 7 hours in this issue. :(

Hope for quick response.

Thanks,
Vineet

BertOtte62
Posts: 1
Joined: 23 Mar 2021, 23:21

24 Mar 2021, 00:13

I also got an error trying the modules : Dropdown, Listbox and TreTable. Error i got :
core.js:6014 ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[Dropdown -> FilterService]:
StaticInjectorError(Platform: core)[Dropdown -> FilterService]:
NullInjectorError: No provider for FilterService!
NullInjectorError: StaticInjectorError(AppModule)[Dropdown -> FilterService]:
StaticInjectorError(Platform: core)[Dropdown -> FilterService]:
NullInjectorError: No provider for FilterService!

lizyjeywin
Posts: 3
Joined: 19 Apr 2021, 10:24

19 Apr 2021, 10:28

I am also getting the same error.
If you - vineetpa\BertOtte62 have identified a resolution plaese let me know here.
Thanks in advance.


My error
ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[Table -> FilterService]:
StaticInjectorError(Platform: core)[Table -> FilterService]:
NullInjectorError: No provider for FilterService!
NullInjectorError: StaticInjectorError(AppModule)[Table -> FilterService]:
StaticInjectorError(Platform: core)[Table -> FilterService]:
NullInjectorError: No provider for FilterService!
at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:725)
at resolveToken (core.js:11918)
at tryResolveToken (core.js:11862)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:11764)
at resolveToken (core.js:11918)
at tryResolveToken (core.js:11862)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:11764)
at resolveNgModuleDep (core.js:20234)
at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:20905)
at resolveDep (core.js:21276)
at resolvePromise (zone.js:852)
at resolvePromise (zone.js:809)
at zone.js:913
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:26247)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)
at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:502)
at invokeTask (zone.js:1693)

lizyjeywin
Posts: 3
Joined: 19 Apr 2021, 10:24

21 Apr 2021, 10:08

I have resolved this by adding FilterService
import { FilterService } from 'primeng/api';
and adding FilterService to the provider's list

PhilHuhn
Posts: 177
Joined: 19 Sep 2018, 02:52
Location: Ann Arbor, Michigan USA
Contact:

22 Apr 2021, 16:25

Hey, as you develop an Angular application you will need to continuously inform the app.module.ts that service, component, pipe, etc are available to the application.

Code: Select all

import { TableModule } from 'primeng/table';
import { FilterService } from 'primeng/api';
//
@NgModule({
	declarations: [
		AppComponent,
		<other components>,
		...
	],
	imports: [
		CommonModule,
		AppRoutingModule,
		TableModule,
		<other modules>,
		...
	],
	providers: [
		FilterService,
		<other services>,
		...
	],
	bootstrap: [AppComponent]
})
export class AppModule { }
Please also see my much more elaborate example of managing the complexities of app.module:
viewtopic.php?f=35&t=64955

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests