Angularjs:an Overview

Source: Internet
Author: User

Angularjs:an OverviewByParas BabbarOnAPR,

Introduction

Angular JS is a very powerful JavaScript library or we can say Open-source the Web application framework maintained by Google. It is used on single Page application (SPA) projects. It extends the HTML DOM with additional attributes (in other words directives) and binds data to HTML with expressions, he nCE making it more responsive to user actions.

It is licensed under the Apache version 2.0 license.

Prerequisites

One should has a basic understanding of JavaScript and any text editor (I'll be using Visual Studio 2015). Since We are developing web-based applications using Angular JS, knowledge of HTML, CSS and AJAX would be a advantage.

Let ' s consider the following example:

  1. <!--Angular JS Example --
  2.   
  3. < div ng-app="" >
  4. <p >
  5. <b>Name:</b> < input type="text" ng-model= "name" />
  6. </p >
  7. < H2 ng-bind="name">
  8.   
  9. </h2 >
  10. </ Div >   

Angular JS extends HTML with ng-directives.

    • The NG-APP directive defines an Angular JS application.
    • The Ng-model directive binds the value of the HTML controls (input, select and text area) to application data.
    • The NG-BIND directive binds application data to the HTML view.

Complete Code

  1. <! DOCTYPE HTML>
  2. < html xmlns="http://www.w3.org/1999/xhtml" >   
  3. <head >
  4. <title>Angular JS 1</title>
  5. < script src="Http://ajax.googleapis.com/ajax /libs/angularjs/1.2.26/angular.min.js "></script>   
  6. </head >
  7. <body >
  8. <!--Angular JS Example --
  9. < div ng-app="" >
  10. <p >
  11. <b>Name:</b> << /c9>input type="text" ng-model ="name" />
  12. </p >
  13. < H2 ng-bind="name">
  14. </h2 >
  15. </div >
  16. </body >
  17. </ HTML >   

Example explained

Angular JS starts automatically when the webpage have loaded.

    • The Ng-app directive tells Angular JS that the <div> element was the "owner" of an Angular JS application.
    • The Ng-model directive binds the value of the input field to the application variable name.
    • The ng-bind directive binds the InnerHTML of the

Output



Note: You can use data-ng-, instead of ng-, if you want to make your page HTML 5 valid.

You'll get more than familiar with Angular JS in a for future article. Keep Visiting

src:http://www.c-sharpcorner.com/uploadfile/cb92fb/angularjs-an-overview/

Angularjs:an Overview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.