Tutorialsplane

Angularjs set input value


Angularjs set input value – It is very simple to set the value attribute of the input field. Here in this tutorial we are going to explain how you can set the input field value in angularjs. You can also use our online editor to edit and run the code online.


Angularjs set input value | Example

Let us go step by step to set the input box value example –

JavaScript Part

JavaScript Part Contains the following part as below –

Angularjs set inputbox value Example :


Html Part

Html Part contains the following html as below –

Angularjs set input value example:

<div ng-app="myApp">  
<div ng-controller="myController">  
  Name 
  
  
       
 
</div> 
</div>

Complete Part

Now let us combine Html and JavaScript Together to create full example like this –

Angularjs set input value example




 
 

  
<div ng-app="myApp">  
<div ng-controller="myController">  
        Name 
		
</div> 
</div>
  

Try it »

If you run the above example it will produce output something like this –