When doing the project today, highlight the maximum minimum value of the part within the table.
Solution Solutions
1. Quoting Ng-class
2. Maximum minimum value for reference prototypes
Instance
AngularJs HTML Code
1 <Tableclass= "UI table celled">2 <thead>3 <TR>4 <th>Title 1</th>5 <th>Title 2</th>6 <th>Title 3</th>7 <th>Title 4</th>8 </TR>9 </thead>Ten <tbody> One <TRng-repeat= "(index, item) in Items"> A <TD>{{Item.list1}}</TD> - <TD>{{Item.list2}}</TD> - <TDNg-class= "{max:index==1| | index==2| | index==3} ">{{ITEM.LIST3}}</TD> the <VDBNg-class= "{max:index==1| | index==2| | index==3} ">{{ITEM.LIST4}}</TD> - </TR> - </tbody> - </Table>View Code
Javascript Code
1 // find the maximum and minimum method of an array 2 function () {3 return Math.max.apply ({},this)4}; 5 function () {6 return Math.min.apply ({},this)7 };
View Code
AngularJs Ng-class Use