AngularJS ng-selected 指令

AngularJS 教程 · 2019-04-02 06:39:32

AngularJS 实例

获取选中的选项:

点击复选框选择 BMW 选项:
<input type="checkbox" ng-model="mySel">

<p>我喜欢的车:</p>

<select>
<option>Volvo</option>
<option ng-selected="mySel">BMW</option>
<option>Ford</option>
</select>

定义和用法

ng-selected 指令用于设置 <select> 列表中的 <option> 元素的 selected 属性。

ng-selected 属性的表达式返回 true 则选项被选中。

语法

<option ng-selected="expression"></option>

<option> 元素支持该指令。

参数值

描述
expression 如果表达式为 true 则选项被选中

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

查看所有标签

A Common-Sense Guide to Data Structures and Algorithms

A Common-Sense Guide to Data Structures and Algorithms

Jay Wengrow / Pragmatic Bookshelf / 2017-8-13 / USD 45.95

If you last saw algorithms in a university course or at a job interview, you’re missing out on what they can do for your code. Learn different sorting and searching techniques, and when to use each. F......一起来看看 《A Common-Sense Guide to Data Structures and Algorithms》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

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

HEX CMYK 互转工具