How to use MatPaginatorIntl?

前端 未结 9 1159
盖世英雄少女心
盖世英雄少女心 2020-12-02 17:59

I\'m using MatPaginator component and I\'m trying to figure out how to translate those labels (documentation isn\'t clear enough about this).

I\'ve found this articl

9条回答
  •  囚心锁ツ
    2020-12-02 18:52

    I had the same issue, and then I changed in app.module.ts in the imports statement TranslateModule to TranslateModule.forRoot()

    So it looks like this:

    imports: [
        ...
        TranslateModule.forRoot()
        ...
    ]
    

    Quote from NPM's site: "The forRoot static method is a convention that provides and configures services at the same time. Make sure you only call this method in the root module of your application, most of the time called AppModule. This method allows you to configure the TranslateModule by specifying a loader, a parser and/or a missing translations handler."

    Here is the whole article: https://www.npmjs.com/package/@ngx-translate/core

    Reading this can help resolving many issues with TranslateModule!

提交回复
热议问题