I'm trying to run a grid component on my page, and I get the following error ...
ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[GridColumnDirective -> GridComponent]:
StaticInjectorError(Platform: core)[GridColumnDirective -> GridComponent]:
NullInjectorError: No provider for GridComponent!
Error: StaticInjectorError(AppModule)[GridColumnDirective -> GridComponent]:
StaticInjectorError(Platform: core)[GridColumnDirective -> GridComponent]:
NullInjectorError: No provider for GridComponent!
at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:8896)
at resolveToken (core.js:9141)
at tryResolveToken (core.js:9085)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:8982)
at resolveToken (core.js:9141)
at tryResolveToken (core.js:9085)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:8982)
at resolveNgModuleDep (core.js:21218)
at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:21907)
at resolveDep (core.js:22278)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
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:1744)
My component ...
import { Component, OnInit } from '@angular/core';
import { data } from './datasource';
import { PageSettingsModel } from '@syncfusion/ej2-angular-grids';
@Component({
selector: 'app-users-page',
templateUrl: './users-page.component.html',
styleUrls: ['./users-page.component.scss'],
})
export class UsersPageComponent implements OnInit {
public data: object[];
public pageSettings: PageSettingsModel
ngOnInit(): void {
this.data = data;
this.pageSettings = { pageSize: 6 };
}
}
My html ..