Home > DeveloperSection > Forums > How to bind text box to the the text
Anupam Mishra

Total Post:135

Posted on    March-03-2016 11:19 PM

 Angular JS JavaScript  Angular JS  CSS 

 1 Reply(s)
 552  View(s)
Rate this:
Hi all,

I have one textbox and i want to enter a username in the Live Preview text box; the text below the text box changes instantly. Please give me a solution.

Thank you.

Sachin Singh
Sachin Singh

Total Post:26

Posted on    March-03-2016 11:43 PM

Hi Anupam,

If We want to bind with text box in angular js then be use ng-bind directives.
Here, below  we are using such bind in the program:

  angular.module('binduserName', [])
  .controller('myController', ['$scope', function ($scope) {
   $scope.username =username;
<div ng-controller="myController">
 <label>Enter User name: <input type="text" ng-model="username"></label><br>
  Hello <span ng-bind="username"> </span>!


Here ,when we changed with another text ,it will display that text in the below of textbox.

Modified On Sep-01-2016 01:46:37 AM

Don't want to miss updates? Please click the below button!

Follow MindStick