The simple application example of the Angularjs tutorial _angularjs

Source: Internet
Author: User
Tags html page

Follow these steps to create a ANGULARJS application

Step 1th: Load the frame

As a pure JavaScript framework, it can be added using the <script> tag.

<script src= "Http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js" >
</script>

Step 2nd: Use the NG-APP directive to define ANGULARJS applications

<div ng-app= "" > ...
</div>

Step 3rd: The schema name defined with the Ng-model directive

<p>enter your name: <input type= "text" ng-model= "Name" ></p>

Step 4th: Define the value bindings in the above model with the ng-bind instruction

<p>hello <span ng-bind= "name" ></span>!</p>

Follow these steps to run the ANGULARJS application

Use the three steps mentioned above in the HTML page.

Testangularjs.html

 
 

Output

Open textangularjs.html in a Web browser. Please enter a name and see the result.

How to integrate Angularjs with HTML

The Ng-app instruction indicates the beginning of the ANGULARJS application.

The Ng-model directive creates a model variable named "name" in an HTML page and has Ng-app instructions used within the DIV.

Ng-bind uses the model name as long as the user input in the text box appears in the HTML span label.

The end of the </div> token represents the end of the Angularjs application.

The above is angularjs simple application, follow-up to continue to collate relevant information, thank you for your support to this site.

Related Article

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.