ngValue (directive)

Improve this Doc View Source ngValue

  1. directive in module ng

Binds the given expression to the value of input[select] or input[radio], so that when the element is selected, the ngModel of that element is set to the bound value.

ngValue is useful when dynamically generating lists of radio buttons using ng-repeat, as shown below.

Directive Info

  • This directive executes at priority level 0.

Usage

  • as attribute:
    <input
      [ng-value=""]>
    ...
    </input>

Arguments

Param Type Details
ngValue
(optional)
string

angular expression, whose value will be bound to the value attribute of the input element

© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.2.32/docs/api/ng/directive/ngValue

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部