---restore content starts---
1: Add a anjular.js file to the HTML page via the <script> tag (it is recommended to place the script at the bottom of the BODY element)
the AngularJS property isng-start, but you can use thedata-ng-to make the Web page valid for HTML5.
2: Common Angular JS directives (instruction)
Ng-app: The directive defines an angular JS application. If you removeNg-appinstruction, HTML will display the expression directly and will not evaluate the result of the expression.
ng-model: Command bar element from (such as input field value) bound to the application
Ng-bind: Command bar Application Data binding to HTML view: The BIND data Direct output directive binds the application variable name to the InnerHTML of a paragraph.
Ng-init: Instruction initialization angular JS application variable
Ng-controller,
Ng-show:
3:angular JS Expression
Angular JS expression is written in double curly braces {{expression}}
Angular JS expression binds data to HTML, which is similar to the Ng-bind directive
Angular JS will "output" data at the position where the expression is written
Angular js expressions and JavaScript expressions: They can contain text, arithmetic, and variables. For example {{5 + 5}} or {{firstName + "" + LastName}}
4:angular JS Application
Angular JS Modules (module) defines the application of Angular JS
Angular JS Controller for controlling Angular is the application
The NG-NPP directive defines the application and Ng-controller defines the controller
| HTML5 allow extended (self-made) properties to start with data- |
Pasting
<! DOCTYPE html>
<meta charset="Utf-8">
<script src="Http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
<body>
<div ng-app="">
<p> Name: <input type="text"Ng-model="name"></p>
</div>
</body>
<div ng-app= "" ng-init= " firstname= ' John ' " >
<p> name is <span ng-bind="FirstName"></span></p>
</div>
Application of Angular JS
<div ng-app="myApp"ng-controller="Myctrl">
Name: <input type="text"Ng-model="FirstName"><br>
Surname: <input type="text"Ng-model="LastName"><br>
<br>
Name: {{firstName +" "+ LastName}}
</div>
<script>//
varApp = Angular.module ('myApp', []);//anggular JS Module
App.controller ('Myctrl', function ($scope) {//anjular JS Controller
$scope. firstname="John";
$scope. lastname="Doe";
});
</script>
Angular JS Introduction