AngularJS ng-class-odd ຄຳສັ່ງ
ການອະທິບາຍ ແລະ ການນໍາໃຊ້
ng-class-odd
ຄຳສັ່ງຈະປະຊຸມລະບົບປະກອບ CSS ຄັນໜຶ່ງຫຼືຫຼາຍຄັນໃຫ້ແກ່ HTML Element, ແຕ່ພຽງແຕ່ການເກີດຂຶ້ນຂອງ HTML Element ທີ່ເກີດຂຶ້ນພາຍໃນສິ່ງນັ້ນທີ່ບໍ່ແມ່ນສິ່ງສະໝອງ (ສິ່ງທີ່ແມ່ນສິ່ງສະໝອງທີ່ແມ່ນຫຼັງຈາກການເກີດຂຶ້ນທີ່ແມ່ນສິ່ງສະໝອງທີ່ກ່ອນມາ) ຈະມີຜົນງານ.
ng-class-odd
ຄຳສັ່ງແມ່ນພຽງແຕ່ຖ້າກັບ ng-repeat
is effective only when used together.
ng-class-odd
Directives are very suitable for setting styles for items in a list or rows in a table, but they can be used for any HTML element.
Example
Set class="striped" for every other row (odd rows) of the table row:
<table ng-controller="myCtrl"> <tr ng-repeat="x in records" ng-class-odd="'striped'"> <td>{{x.Name}}</td> <td>{{x.Country}}</td> </tr> </table>
Syntax
<element ng-class-odd="expression</element>
All HTML elements support.
Parameter
Parameter | Description |
---|---|
expression | Return an expression for one or more class names. |