gpt4 book ai didi

angular - Angular DOM 中的 StaticInjectorError

转载 作者:行者123 更新时间:2023-12-02 00:56:16 28 4
gpt4 key购买 nike

当我在 Angular 中使用表格元素时,有时会在浏览器的控制台中显示此错误
有什么问题?
我该如何解决?
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: 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)

我正在使用延迟加载模块
契约(Contract)模块:
@NgModule({
imports: [
SharedModule,
KendoSharedModule,
SmartadminModule,
SmartadminValidationModule,
PaginationModule.forRoot(),
DpDatePickerModule,
NgxMaskModule.forRoot(),
SmartadminWizardsModule,
ContractRoutingModule,
],
providers: [ContractResolverService],
declarations: [AddContractComponent, ListContractComponent, AddWarrantyComponent]
})
export class ContractModule { }

最佳答案

面临同样的问题,发现它是由从 Kendo 导入“SharedModule”引起的。

关于angular - Angular DOM 中的 StaticInjectorError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53976202/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com