Hi
In Angular Version 17 AppModule does not exist where i should write this code & also the code marked in Green. Image attached
import { BrowserAnimationModule} from '@angular/platform-browser/animations';

Thanks
Hi
In Angular Version 17 AppModule does not exist where i should write this code & also the code marked in Green. Image attached
import { BrowserAnimationModule} from '@angular/platform-browser/animations';

Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Apr 18, 2024, 11:43 PM EDT
In Angular, regardless of the version, the
AppModuleis a fundamental part of the application structure. If you can’t find it, it might be due to a different project structure or a custom configuration.The code you’ve written seems to be importing the
BrowserAnimationsModulefrom@angular/platform-browser/animations, which is correct. However, there seems to be a typo in your import statement. It should beBrowserAnimationsModule, notBrowserAnimationModule.Here’s a basic example of how you can use it:
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, BrowserAnimationsModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }In this code,
BrowserAnimationsModuleis imported and added to theimportsarray in@NgModule. This makes animation support available everywhere in your application.Please replace
'./app.component'with the path to your actualAppComponent.Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Apr 19, 2024, 12:24 AM EDT
Hi Naimish
I have attached image . It is snot showing . What can be the reason
Thanks