ng-checked

AngularJS 参考手册 AngularJS 参考手册

AngularJS 实例

选择一个或选择所有选项:

<body ng-app="">
<p>My:</p>
<input type="checkbox" ng-model="all"> Check all<br><br>

<input type="checkbox" ng-checked="all">Volvo<br>
<input type="checkbox" ng-checked="all">Ford<br>
<input type="checkbox" ng-checked="all">Mercedes
</body>

尝试一下 »

定义和用法

ng-checked 指令用于设置复选框(checkbox)或单选按钮(radio)的 checked 属性。

如果 ng-checked 属性返回 true,复选框(checkbox)或单选按钮(radio)将会被选中。

语法

<input type="checkbox|radio" ng-checked="expression"></input>

type 为 checkbox 或 radio 的 <input> 元素支持。

参数值

描述
expression 如果返回 true,将会选中元素选项。

本在线速查手册由www.w┏┓3┏┓x┏┓u┏┓e.com提供,请勿盗用!

AngularJS 参考手册 AngularJS 参考手册