Examples of simple applications and AngularJS tutorials

Source: Internet
Author: User

Examples of simple applications and AngularJS tutorials

Follow these steps to create an AngularJS Application

 Step 2: load the framework

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 2: Use the ng-app command to define AngularJS applications

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

Step 1: Use the mode name defined by the ng-model command

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

Step 2: Use the ng-bind command to bind the values in the above model to the definition.

<P> Hello <span ng-bind = "name"> </span>! </P>

Follow these steps to run AngularJS applications

Use the three steps mentioned above to go To the HTML page.

TestAngularJS.html

<Html> <title> AngularJS First Application </title> <body> 

Output

Open textangularjs.html in the webbrowser. Enter the name and the result.

How to integrate AngularJS with HTML

The ng-app command indicates the beginning of the AngularJS application.

The ng-model command creates a model variable named "name" on the HTML page, and the ng-app command is used in the div.

Ng-bind the model name is displayed in the HTML span tag as long as what you enter in the text box.

The end </div> flag indicates the end of The AngularJS application.

The above is a simple AngularJS application. We will continue to sort out relevant materials in the future. Thank you for your support for 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.