VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-ng-value-directive/

⇱ AngularJS ng-value Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-value Directive

Last Updated : 11 Jul, 2025

The ng-value Directive in AngularJS is used to specify the value of an input element. This directive can be used to achieve the one-way binding for the given expression to an input element, especially when the ng-model directive is not used for that specific element. It is supported by <input> and <select> elements. 

Syntax:

<element ng-value="expression">
 Content ... 
</element> 

Parameter value:

  • expression: It specifies the value that is bound with the element's value attribute & value property. It is of string type.

Example 1: This example describes the basic usage of the ng-value Directive in AngularJS.

Output:

👁 Image
 

Example 2: This example describes the ng-value directive in AngularJS, where a value is selected from the list & correspondingly, rendering that value.

Output:

👁 Image
 
Comment

Explore