InterviewHubPRO
Section Overview
Q103

Question 103 of 283

Part 5: Animations, Service Workers, Ivy Engine & Builders (101 - 123)

36%
Angular & Signals (283 Qs)•Part 5: Animations, Service Workers, Ivy Engine & Builders (101 - 123)

What is State function?

Angular's state() function is used to define different states to call at the end of each transition. This function takes two arguments: a unique name like open or closed and a style() function.

For example, you can write a open state function

javascript
state('open', style({
height: '300px',
opacity: 0.5,
backgroundColor: 'blue'
})),