ng style
snippet in html

ngstyle

user7124

<div [ngStyle]="{'background-color':person.country === 'UK' ? 'green' : 'red' }"></<div>

ng style

user8183

<some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element> 

ngstyle

user6493

      
        content_copy
      
      <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
    

ng content

user3692

<!-- for dynamic content in components -->

<ng-content></ng-content> <!-- in app-component template -->

<app-component>
  <!-- insert html here -->
</app-component>