AngularJs ng-bind Example

What is an ng-bind directive?

The “ng-bind” as the name suggest is used to bind/replace text content of any particular HTML element with the value of given expression that is used against the ng-bind. The value of the specified HTML element will be updated whenever the value of given expression will be changes.


<!DOCTYPE html>
<html lang="en">

  <title>Angular Demo</title>
  <script data-require="angular.js@1.5.x" src="" data-semver="1.5.8"></script>
    var myApp = angular.module("AngularApp", []);
    myApp.controller("HelloController", function($scope) {
      $scope.text = "enter text here...";

<body ng-app="AngularApp">
  <div ng-controller="HelloController">
    Enter anything you want to display:
    <input type="text" ng-model="text">You Entered : <span ng-bind="text"></span>


The Live demo,

About Blogger


Hey! I am Anil Singh. I am Active Blogger, Writer and Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...

    Blogger Comment
    Facebook Comment
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book