Need to stylize a fragment in Angular, please tell me how it can be done?
<div class="title-block">Interval #{{i + 1}} - {{ item.type == 'lorem' ? 'Lorem type' : 'Style type' }}</div> You need to add other styles to this little 'Style type'
Interval #{{i + 1}} -...">
You can wrap this piece in a tag and give it a class:
<div class="title-block">Interval #{{i + 1}} - <span class="someClass">{{ item.type == 'lorem' ? 'Lorem type' : 'Style type' }}</span></div> You can wrap up and set the class according to the same condition:
<div class="title-block"> Interval #{{i + 1}} - <span [ngClass]="{'someclass': item.type != 'lorem' }"> {{ item.type == 'lorem' ? 'Lorem type' : 'Style type' }} </span> </div> Source: https://ru.stackoverflow.com/questions/799023/
All Articles