Animation is the transition from one state of an element to another state. Animations are an integral part of any modern web application, which help us to create a great UI experience for user. Angular allows us to create animations which provides us similar native performance as CSS animations. Angular defines three different states for an element:-
Void State
The wildcard State
Custom State
Angular animations can be created easily by following below steps-
Step 1:- Import BrowserAnimationsModule in app.module.ts
file and provide it in the import array.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule
],
providers: [],
bootstrap: [
AppComponent
]
})
export class AppModule { }