Binding CSS styles to a tag in Angular

We can also set a specific set of styles for an HTML element. This is done using the ngStyle directive. An object with CSS properties and their values ​​should be passed to this directive.

Let's try:

app/app.component.html<div [ngStyle]="{'color': 'red', 'font-size': '20px'}">
  text
</div>
Задание 1

Given object:

app/app.component.tsexport class AppComponent {
  public obj = {
    color: red,
    fontSize: '30px',
    fontWeight: 'bold'
  }
}

Style any tag using this object.