AngularJS ng-class-even 指令

AngularJS 教程 · 2019-04-01 13:37:27

AngularJS 实例

为表格的偶数行设置 class="striped":

<table ng-controller="myCtrl">
<tr ng-repeat="x in records" ng-class-even="'striped'">
    <td>{{x.Name}}</td>
    <td>{{x.Country}}</td>
</tr>
</table>

定义和用法

ng-class-even 指令用于为 HTML 元素动态的绑定一个或多个 CSS 类,但只作用于偶数行。

ng-class-even 指令需要与 ng-repeat 指令搭配使用。

ng-class-even 指令建议用在表格的样式渲染中,但是所有HTML元素都是支持的。

语法

<element ng-class-even="expression"></element>

所有 HTML 元素都支持。

参数值

描述
expression 表达指定一个或多个 CSS 类。

点击查看所有 AngularJS 教程 文章: https://codercto.com/courses/l/36.html

查看所有标签

Web 2.0 Heroes

Web 2.0 Heroes

Bradley L. Jones / Wiley / 2008-04-14 / USD 24.99

Web 2.0 may be an elusive concept, but one thing is certain: using the Web as merely a means of retrieving and displaying information is history. Today?s Web is immediate, interactive, innovative. It ......一起来看看 《Web 2.0 Heroes》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具