What is Style function?

The style function is used to define a set of styles to associate with a given state name. You need to use it along with state() function to set CSS style attributes. For example, in the close state, the button has a height of 100 pixels, an opacity of 0.8, and a background color of green.

state('close', style({
height: '100px',
opacity: 0.8,
backgroundColor: 'green'

Note: The style attributes must be in camelCase.

October 29, 2022