PrimeNG v18+ with non- standalone components #3506
-
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? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I upgraded from Angular 18 and PrimeNG 17, without using app.config.ts. I placed the theming/style in the app.component.ts. I have a limited StackBlitz example. |
Beta Was this translation helpful? Give feedback.
-
You can simply use the providers in your Simply import your PrimeNG components as always and use the providePrimeNG Provider in your AppModule providers section. providers: [ |
Beta Was this translation helpful? Give feedback.
You can simply use the providers in your
app.module.ts
fileSimply import your PrimeNG components as always and use the providePrimeNG Provider in your AppModule providers section.
Here is an example how I archived this
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideAnimationsAsync(),
providePrimeNG({
theme: {
preset: Lara,
options: {
darkModeSelector: '.darkmode',
},
},
}),
MessageService,
ConfirmationService,
TranslateService,
],