“Ngstyle” Respostas de código

Ngstyle

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

Ngstyle

<div [ngStyle]="{'background-color':'green'}"></<div>
Crazy Cardinal

Ngstyle

[ngStyle]="{'background-image': 'url(' + data.headerImage + ')'}"
Healthy Hummingbird

Ngstyle

[ngStyle]="{'opacity': is_mail_sent ? '0.5' : '1' }"
Zany Zebra

Ngstyle

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

Ngstyle

[ngStyle]="{'opacity': is_mail_sent ? '0.5' : '1' }"

[style.background-color]="myColorVaraible"

[ngStyle]="styleOne?{'background-color': 'red'} : {'background-color': 'blue'}"
<div [style.background-color]="style1 ? 'red' : (style2 ? 'blue' : null)">


Farwa Miraj

Ngstyle

<div [ngStyle]="someFunctionInYourComponent()">
Xanthous Xenomorph

Procure respostas de código populares por idioma

Procurar outros idiomas de código