Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StaticInjectorError in angular DOM

Tags:

angular

When I use table element in Angular sometimes show me this error in the console of the browser What's the problem?
How can I solve it?
angular HTML:

<table class="table table-striped table-hover table-bordered table-condensed  ">
  <thead>
    <tr class="tr-bottom-color-orrange">

      <th class="text-center">name</th>

    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let item of listItem">

      <td class="text-left">
        {{ item.name }}
      </td>      
    </tr>

  </tbody>
</table>  

error:

ERROR Error: StaticInjectorError(AppModule)[TableDirective -> ColumnResizingService]: 
  StaticInjectorError(Platform: core)[TableDirective -> ColumnResizingService]: 
    NullInjectorError: No provider for ColumnResizingService!
    at _NullInjector.get (core.js:1002)
    at resolveToken (core.js:1300)
    at tryResolveToken (core.js:1242)
    at StaticInjector.get (core.js:1110)
    at resolveToken (core.js:1300)
    at tryResolveToken (core.js:1242)
    at StaticInjector.get (core.js:1110)
    at resolveNgModuleDep (core.js:10854)
    at NgModuleRef_.get (core.js:12087)
    at resolveNgModuleDep (core.js:10854)

I'm using lazy loading module ContractModule :

@NgModule({
  imports: [
    SharedModule,
    KendoSharedModule,
    SmartadminModule,
    SmartadminValidationModule,
    PaginationModule.forRoot(),
    DpDatePickerModule,
    NgxMaskModule.forRoot(),
    SmartadminWizardsModule,
    ContractRoutingModule,
  ],
  providers: [ContractResolverService],
  declarations: [AddContractComponent, ListContractComponent, AddWarrantyComponent]
})
export class ContractModule { }
like image 716
Mohammad Daliri Avatar asked Oct 26 '25 06:10

Mohammad Daliri


1 Answers

Was facing the same issue and found it was caused by importing the 'SharedModule' from Kendo.

like image 71
Steve MacDonald Avatar answered Oct 28 '25 23:10

Steve MacDonald