First talk about what Angularjs is.
First Angularjs is a JavaScript framework.
(PS: Actually is an external reference to the JS file)
so the use of ANGULARJS is still external reference JS file.
Attach a reference address
<src= "Http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"> </script>
Use of Angularjs:
First, on the code. (Let me raise a chestnut first)
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><title>AngularJS</title></Head><Body> <DivNg-app=""> <P>Try the effect:<inputtype= "text"Ng-model= "My_model" /></P> <H1>Here is your model value: {{My_model}}</H1> </Div> <!--Reference JS - <Scriptsrc= "Angular-1.3.0.js"type= "Text/javascript"></Script></Body></HTML>
Analytical:
This example is a simple ANGULARJS value model.
One of the ANGULARJS features: can be embedded in any frame for use.
Please look at the chestnut, there is a ng-app behind the Div, this is to tell the browser from the beginning of the code inside the Angularjs tube ( regardless of your matter, ANGULARJS management in the back of the area ). As for the value of Ng-app, this dish has not been tested yet. The following test will explain the course. It is also possible to say what the great God knows. That is to say Ng-app add where, which piece of content uses Angularjs. To emphasize that,Ng-app a page has and can only have one, cannot appear multiple Ng-app. Here we go. Ng-app is understood as the main method, and the entry procedure has only one.
Angularjs feature two: MVC pattern development.
Back to the chestnut, the input tag is also a ng beginning of the East, yes this is the model in Model,mvc. Do not doubt, Angularjs is so great, is so powerful. and then h1 the middle of {{}} is to get the value of model ( I believe that a lot of the other templates of Daniel see it ), strictly speaking <input type= "text" ng-model= "My_model"/> here is the value of the view to show the model. and {{My_model}} is the real model. (Well, the table asked me where Controler went.) Speaking of Controler will talk about module, so the back of the DAO).
The first mystery is so much more than a beep. Original articles, thanks for support. Daniel, don't squirt .
Angularjs Quest < A >