AngularJS ng-class-odd 指令

AngularJS 教程 · 2019-04-01 13:59:02

AngularJS 实例

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

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

定义和用法

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

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

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

语法

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

所有 HTML 元素都支持。

参数值

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

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

查看所有标签

Once Upon an Algorithm

Once Upon an Algorithm

Martin Erwig / MIT Press / 2017-9-8 / GBP 22.95

How Hansel and Gretel, Sherlock Holmes, the movie Groundhog Day, Harry Potter, and other familiar stories illustrate the concepts of computing. Picture a computer scientist, staring at a screen and......一起来看看 《Once Upon an Algorithm》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码

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

HEX CMYK 互转工具