admin管理员组

文章数量:1310237

I need to upgrade the primeNG library to v19 on my angular project. My project is not configured to use standalone components - hence I don't have an app.config.ts file in my project. From what I understand in primeNG from v18 and on - the styles need to be provided in this file. Is there a way to use primeNG without this file?

I need to upgrade the primeNG library to v19 on my angular project. My project is not configured to use standalone components - hence I don't have an app.config.ts file in my project. From what I understand in primeNG from v18 and on - the styles need to be provided in this file. Is there a way to use primeNG without this file?

Share Improve this question asked Feb 2 at 15:19 more21more21 115 bronze badges 2
  • have you visited the documentation, please try it and change the question with the issue you face when implementing the documentation steps – Naren Murali Commented Feb 2 at 16:04
  • the documentation says what I wrote in the question - that the styles need to be provided in the app.config.ts file, which I don't have – more21 Commented Feb 3 at 8:59
Add a comment  | 

1 Answer 1

Reset to default 0

@MoInMaRvZ answered this here

We can simply add the code directly in the app.module.ts file. Like this:

providers: [
    provideHttpClient(withInterceptorsFromDi()),
    provideAnimationsAsync(),
    providePrimeNG({
        theme: {
            preset: Lara,
            options: {
                darkModeSelector: '.darkmode',
            },
        },
    }),
]

本文标签: angularPrimeNG v18 with non standalone styleStack Overflow