HOW TO BIND TEXT BOX TO THE THE TEXT

Anupam Mishra

Total Post:135

Points:949
Posted by  Anupam Mishra
 623  View(s)
Ratings:
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.
  1. Sachin Singh

    Post:26

    Points:182
    Re: How to bind text box to the the text

    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:

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

    Output:



    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!