在阅读How to use MatPaginatorIntl?之后,我成功地设法使MatPaginatorIntl适应我的需求。
但是,我想知道如何在我的Angular App中为不同种类的表使用不同的MatPaginatorIntl?
我已添加到我的AppModule.ts providers: [{ provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro}],
但只是添加另一个MatPaginatorIntl作为提供者不会改变我的问题,因为我只能提供一个。
所以我可能必须找到一种方法来为不同的表使用不同的MatPaginatorIntl提供程序。有谁知道如何处理这个问题?
非常感谢你提前!
如果我理解你的问题,我不知道。正如您在app.module.ts
的提供程序中添加的那样,它适用于所有组件。
尝试将这些提供程序放在component
中使用paginator
的最近/封闭模块中。