Angularjs hello world tutorial

First include the AngularJS library in the application. The ng-app directive initializes the application. The ng-model directive binds the state of the input text to the name variable. When we enter a value in name input box, the corresponding value will automatically updated in next line.

Example:

<html>
 <script src=
   "http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js">
 </script>
 <body>
   <div ng-app="">
    <p>Name: <input type="text" ng-model="name"></p>
     <h1>Hello {{name}}</h1>
    </div>
 </body>
</html>

Try it:

JS Bin on jsbin.com  

Please follow and like us:
Content Protection by DMCA.com