-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown: requires import of BrowserAnimationsModule, which prevents Angular application from loading #14843
Comments
Hi, i solved it using the provideAnimations function in the application config. import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { provideAnimations } from '@angular/platform-browser/animations';
export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes), provideAnimations()]
}; If you see the function's documentation you will see that this function is for enable the animations in applications created with the function bootstrapApplication. I hope you find it helpful :) |
Big thanks @manuelhumanescabrera, it works as expected now! 🙏 I guess it's just PrimeNG documentation that needs updating, to account for changes in the newer Angular versions. I will create a separate issue for that later. |
@manuelhumanescabrera Genius! Saved my project♥ Thxs |
U saved me <3 |
thank you @manuelhumanescabrera |
@manuelhumanescabrera Thanks! |
@manuelhumanescabrera God bless you! I struggled with this problem for 2 days |
it works thanks ! |
Why doesn't this just work when |
thanks @manuelhumanescabrera - it's be great if this error message could also include info for those of us using standalone components also - please let me know how I can buy you a coffee or beer :) |
Awesome, thank you so much @manuelhumanescabrera. |
Amazing, thanks manuelhumanescabrera |
This works perfectly on my end. Thanks for sharing, @manuelhumanescabrera! |
Thank you, it works for me too! |
Thanks!! |
You are amazing !!! |
Describe the bug
Trying to open the PrimeNG dropdown fails and the following error is displayed in the console:
However, importing
BrowserModule
andBrowserAnimationsModule
(orNoopAnimationsModule
) in the root module as described in https://primeng.org/installation#animations, prevents the application from loading (even though it compiles successfully), with the following error in the console:According to Angular documentation (https://angular.io/api/platform-browser/BrowserModule) the
BrowserModule
is now loaded by default for the applications, generated with the CLI. However, PrimeNG documentation does not provide information on configuring animations in the latest Angular versions, where the module is being automatically loaded. As a result, the Dropdown component is unusable.Environment
Linux 6.7.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 17 Feb 2024 14:02:33 +0000 x86_64 GNU/Linux
Reproducer
https://stackblitz.com/edit/stackblitz-starters-apxsx8?file=src%2Fmain.ts
Angular version
17.1.0
PrimeNG version
17.7.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.11.0
Browser(s)
No response
Steps to reproduce the behavior
BrowserModule
andBrowserAnimationModule
as described in the error and PrimeNG installation guideExpected behavior
The dropdown should open without error in the console. It also shouldn't require importing
BrowserModule
andBrowserAnimationModule
anymore. Alternatively, if that's not the case, the documentation should mention how to make the dropdown work as expected.The text was updated successfully, but these errors were encountered: