First, the basic grammar
Basic concepts
-Ng-controller
function Controllername ($scope, $http, $element) {}
$scope
$http
-$http. Get (URL). sucess (function (result) {})
Defining basic data types
-$scope. Name = "John"
-$scope. email = [email protected]
-$scope. Age = 30
Defining Object Properties
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7E/94/wKioL1cE3RHiTyWCAABR44Zj66k025.png "title=" Web.png "alt=" Wkiol1ce3rhitywcaabr44zj66k025.png "/>
Defining methods
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7E/97/wKiom1cE3KKwRxfJAAGGE793Dec876.png "title=" Web.png "alt=" Wkiom1ce3kkwrxfjaagge793dec876.png "/>
Second, the module
Registering a controller with a module
Basic concepts
-Injection: DI
-Centralized management through models
-Reduced coupling through model registration
Grammar
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7E/97/wKiom1cE3aSR3XbaAAF3Nb_cAXQ868.png "title=" Web.png "alt=" Wkiom1ce3asr3xbaaaf3nb_caxq868.png "/>
Module reference
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7E/94/wKioL1cE3qfQg-MBAAFjER8r39k220.png "title=" Web.png "alt=" Wkiol1ce3qfqg-mbaafjer8r39k220.png "/>
Summary: This chapter mainly introduces the AngularJS controller (basic syntax), modules (using the module registration Controller)
This article from the "Flying Ants" blog, declined to reprint!
ANGULARJS Base-3 controller (basic Syntax), module (using Module registration Controller)