Hi, Thank you very much for the feedback!
The problem is that I want to update the color every time someOtherValue changes, not only on the initialization of the element. Do you have any ideas on how I could do this? Best regards, Filip Davidović. On Tue, 28 Aug 2018 at 07:27, Sander Elias <[email protected]> wrote: > Hi Filip, > > <h3 [style.color]="someVar < 30 ? 'green' : 'red'>{{someOtherValue}}</h3> > > or: > <h3 [style.color]="someVar'>{{someOtherValue}}</h3> > > and then in your components controller: > > ngOninit() { > this.someVar="red"; > setTimeout(() => this.someVar="green",1500) > } > > > Hope this helps. Use the framework, don't manipulate dom directly unless > you have to. > > Regards > Sander > > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
