vendredi 16 septembre 2016

angularjs if/else if/else (switch) condition

Hi I have a question here the code and data i have is here

     <div class="table-row" ng-repeat="x in myData" >
     <div class="table-cell" ></div>
     <div class="table-cell"><span class="table-cell-asset">        
      </span><br/> 
     <span class="table-cell-changes">%/      
     </span></div>
     </div>

changePercent is a float number that can be positive or negative or 0 i want to add a similar if/else statement to have is change color of changePercent and changeDollar for positive negative or 0. I know a controller will do the job. I wonder if i can do it with some directive inline code to finish the comparison and change the color by result.

Aucun commentaire:

Enregistrer un commentaire