Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the css of the li:before with ng-style

I want to change the width value of the li:before with a variable scope (width).

 <ul>
    <li ng-repeat="step in stepsList" ng-style="{li:before { 'width': width;}"
        ng-class="{true: 'active'}[step.active]">
        <span>{{step.stepName | uppercase}}</span>
    </li>
</ul>

I'm doing this code but it's not working. help please.

like image 925
user2774431 Avatar asked Oct 19 '25 22:10

user2774431


1 Answers

Unfortunately you cannot have pseudoelements within inline styling. What you could do is have two sepparate CSS Classes like

.a:before {}
.b:before {}

This way you could use ngClass to add the appropriate class to your HTML

like image 192
Dan Moldovan Avatar answered Oct 22 '25 11:10

Dan Moldovan