Complete the code to bind a dynamic background color using ngStyle.
<div [ngStyle]="{'background-color': [1]">Colored Box</div>
The variable bgColor holds the dynamic color value used in ngStyle.
Complete the code to apply multiple dynamic styles using ngStyle.
<div [ngStyle]="[1]">Styled Text</div>
ngStyle expects an object with style properties as keys and their values. The correct syntax uses curly braces and property-value pairs.
Fix the error in the ngStyle binding to correctly apply a dynamic width.
<div [ngStyle]="{'width': [1] + 'px'}">Box</div>
The variable widthValue should be used without quotes inside the expression. The string concatenation happens outside the binding.
Fill both blanks to set dynamic height and background color using ngStyle.
<div [ngStyle]="{'height.px': [1], 'background-color': [2]">Box</div>
Use boxHeight for height and bgColor for background color variables from the component.
Fill all three blanks to create a dynamic style object with font size, color, and margin.
<p [ngStyle]="{'font-size.px': [1], 'color': [2], 'margin.px': [3]">Text</p>
Use fontSize, textColor, and marginSize variables to set the respective styles dynamically.