在阅读了How to use MatPaginatorIntl?之后,我成功地使MatPaginatorIntl适应了我的需求。
然而,我想知道如何在我的Angular应用程序中为不同种类的表使用不同的MatPaginatorIntl?
我已添加到我的AppModule.ts providers: [{ provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro}],中
但是仅仅添加另一个MatPaginatorIntl作为提供者并不能改变我的问题,因为我只能提供一个。
因此,我可能必须找到一种方法来为不同的表使用不同的MatPaginatorIntl提供程序。有谁知道如何解决这个问题吗?
非常感谢您的提前!
发布于 2019-02-17 19:38:13
我不知道我是否正确理解了你的问题。正如您在app.module.ts的提供程序中添加的一样,它将应用于所有组件。
尝试将这些提供程序放在使用paginator的component的最近/封闭模块中。
https://stackoverflow.com/questions/54724494
复制相似问题