-The most important concept in angular is instruction (directive)
-Ng-model is a bidirectional data binding directive, and the effect is to bind the Value property of the current element to [User.Name] in the model
# # # modules (module)
-We can create a module from Angular.module
-Angular.module method to pass two parameters is to create the module, one parameter is to get the module
# # # Controllers (Controller)
-Common method: <div ng-controller= "Hellocontroller" ></div>//ng-controller attribute is placed on the package label, control the code inside the package
In JS code:
-var module = angular.module (' HelloApp ', [])
-Module.controller (' Hellocontroller ', [' $scope ', ' $http ', function (A, b) {
Console.log (a);//The $cope object is printed
}]);
-by $scope and view associations
-$scope. $watch ('/* to monitor for changes in values */', function (now,old) {
Console.log (now);//The value entered
Console.log (old);//Input Previous value
})
-A NG plugin is recommended here: AngularJS Batarang, the NG Debug tool can be found under the Chrome console after installation
# # # expressions (expression)
{{}}
Angularjs expressions are much like JavaScript expressions, and they can contain an
literals, operators, and variables such as {{5 + 5}} or {{firstName + '-' + LastName}},
Number {{100 + 100}},
string {' Hello ' + ' angular '},
Object {{Zhangsan.name}},
Array {{STUDENTS[10]}}
Compare JavaScript Expressions:
The same point: the AngularJS expression can contain letters, operators, and variables.
Different points: AngularJS expressions can be written in HTML. AngularJS expressions do not support conditional judgments, loops, and exceptions. The AngularJS expression supports filters.
# # # Resolves a bug where ng appears first when loading a page
<style>
/* Ng-cloak instructions are automatically removed after Ng execution is completed.
[Ng-cloak],
. ng-cloak {
Display:none;
}
</style>
<body ng-app class= "Ng-cloak" ></body> or <body Ng-app ng-cloak></body>
This article transferred from: http://www.cnblogs.com/lm970585581/archive/2017/04/06/6672367.html
"Reprint" Angular.js Study notes (i)