Issues
The DatePicker, dropdown, and checkbox built-in functionalities were not working. Specifically, when clicking on the DatePicker, the animation required for it to open was not triggered, resulting in the DatePicker not opening.
Solution:
Import
BrowserAnimationsModule
afterBrowserModule
in the application configuration file.(
app.config.ts
).
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes, ...routerFeatures),
importProvidersFrom(BrowserModule),
importProvidersFrom(BrowserAnimationsModule),
],
}
Reason:
The issue occurred because the DatePickerβs click animation was not working due to the BrowserAnimationsModule
not being imported. Once we imported BrowserAnimationsModule
after BrowserModule
in the app configuration file, the DatePicker started working correctly.
***************************************************************************************
2. The DomaniRx theme file styles were not being applied in the Angular project. As a result, UI components were not displaying with the intended theme styling.
Solution:
Add styles in the correct order inside
angular.json
:
Ensure that the DomaniRx theme file is listed last so that it overrides other styles when necessary:"styles": [ "node_modules/primeicons/primeicons.css", "node_modules/primeflex/primeflex.css", "node_modules/@domanirx/theme/domanirx.css" ]
Provide PrimeNG configuration in
app.config.ts
:
ImportprovidePrimeNG
and configure the theme preset (Aura
) with the proper CSS layer order:import { providePrimeNG } from 'primeng/config'; import Aura from '@primeng/themes/aura'; export const appConfig: ApplicationConfig = { providers: [ providePrimeNG({ theme: { preset: Aura, options: { cssLayer: { name: 'primeng', order: 'theme, base, primeng' } } }, ripple: true, }) ] };
Reason for using
preset: Aura
:
TheAura
preset in PrimeNG provides a modern, pre-defined theme configuration with consistent colors, typography, spacing, and component styles. Without specifying a preset likeAura
, PrimeNG components would fall back to default, unstyled behavior or might not apply the intended design system. By usingAura
, the application ensures that all PrimeNG components follow a cohesive and visually appealing theme that matches the desired design guidelines.Ensure
primeflex
is included inpackage.json
:
Addprimeflex
as a dependency if not already present:"dependencies": { "@domanirx/theme": "../../../Downloads/theme-1.18.8.tgz", "primeflex": "^3.2.1" }
Reason:
The issue occurred because the DomaniRx theme styles were either being overridden or not loaded in the correct order. In Angular, style files listed earlier in angular.json
can be overridden by those listed later. By placing the DomaniRx theme file last, its styles take precedence. Additionally, PrimeNG requires a proper configuration (providePrimeNG
) to initialize its theme layers correctly. Missing primeflex
dependency also prevented utility classes from being applied. Implementing these changes ensured that the theme styles loaded correctly and the UI displayed as intended.