Search code examples
angularprimeng

PrimeNG v18+ with non- standalone style


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?


Solution

  • @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',
                },
            },
        }),
    ]