AngularJS - Hello World

  • Angular JS is a javascript opensource powerful framework.

  • Angular JS provides us the efficient way to create Single Page Application (SPA).

  • Angulars JS  lets you to extend traditional HTML.

  • Extensible and works well with the other libraries.




  • Angular JS helps you to  write clean MVC (Model View Controller) Javascript code.
  • It uses HTML has the template language, by extending the DOM attributes.


Angular JS Hello World

  Like any other framework Angular JS also needs to be added in the script tag src 
  <script src=""></script>


Tells the framework that the HTML block is Angular application.

<body ng-app="myapp" ></body>


Intended to be put inside of form elements and has two-way data binding ($scope -> view and view -> $scope)  

<input type="text" ng-model="uname" >

{{ }} Declaration

Specifying the Angular JS variables inside the HTML tags.
<h1>{{ uname }}</h1>

Hello World 

  1. <!doctype html>
  2. <html ng-app>
  3. <head>
  4. <script src=""></script>
  5. </head>
  6. <body>
  7. <div>
  8. <label>Name:</label>
  9. <input type="text" ng-model="uname" placeholder="Enter a your name">
  10. <hr>
  11. <h1>Hello {{uname}}!</h1>
  12. </div>
  13. </body>
  14. </html>

1 comment

Unknown said...

Good Article!

Powered by Blogger.