• Java IO
  • Spring
  • SQL Tutorial
  • jQuery
  • JSP
  • PHP
  • Struts
  • Servlet
  • JavaScript

  • <

    AngularJS Introduction

    AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag.

    AngularJS extends HTML attributes with Directives, and binds data to HTML with Expressions.

    AngularJS expressions are written inside double braces: {{ expression }}.

  • The ng-app directive tells AngularJS that the <div> element is the "owner" of an AngularJS application.

  • The ng-model directive binds the value of the input field to the application variable name.

  • The ng-bind directive binds the content of the

    element to the application variable name.



  • AngularJS Example



    <!DOCTYPE html>
    <html>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
    <body>
    
    <div ng-app="">
     
    <p>Input something in the input box:</p>
    <p>Name: <input type="text" ng-model="name"></p>
    <p>{{name}}</p>
    
    </div>
    
    </body>
    </html>
    


    Example 2



    
    <!DOCTYPE html>
    <html>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
    <body>
    
    <div ng-app="">
    <p>Expression: {{ 10 + 5 }}</p>
    </div>
    
    </body>
    </html>
    
    
    
















    © copyright 2017-2021 Completedone pvt ltd.