NgStyle
Try binding ngStyle to a key:value control object. Each key of the object is a style name; its value is whatever is appropriate for that style.
Consider a setCurrentStyles component method that sets a component property, currentStyles with an object that defines three styles, based on the state of three other component properties:
Adding an ngStyle property binding to currentStyles sets the element's styles accordingly:
Last updated
Was this helpful?