To let Angularjs render the entire page, or you can use the
<div ng-app= ' MyApp ' >......</div>
To render a portion of them.
2, Ng-modelNg-model, when your data model is changed, such as ng-model= ' test ', where the value of this test is changed, the value of {{test}} will follow the change, that is, the test connected to Ng-model also follows the change, as follows
<!doctype html>
3, Angular.moduleThis is mainly to do the module registration, creation and indexing, for example, we ng-app want to register this as a service to use, when we reference the index of a module to use
Angular.module (name, [requires], [CONFIGFN]); The name of the retrieval module created by the #name type string #requires simple Understanding is the use module that you need to include, For example, Ngroute routing module #configfn can be optional function module, function and Module.config similar
4. ControllerController is angular. The method controller (name, constructor) in module, where name is the name of the controller and constructor is the director constructor, we use a piece of code to illustrate
<!doctype html>
5. ValueValue is also angular. The method in module is value (name, object), where name is the name of the service, object is the server instance, and we can modify the code above
<!doctype html>
6, FactoryFactory is also angular. Method factory in module (name, providerfunction);; Where name is the name of the service, Providerfunction is the function used to create the new server object, and this is where we can modify the code above.
Copy the code code as follows:
<!doctype html>
Provider is also angular. The method in module provider (name, ProviderType), where name is the name of the service, Providerfunction is the function used to create a new server object, which is similar to factory, We're now rewriting it with provider.
Copy the code code as follows:
<!doctype html>
8. ServiceService is also angular. The method service (name, constructor) in module, where name is the name of the service, constructor a constructor to be instantiated, which is similar to factory, which we now rewrite with service
Copy the code code as follows:
<!doctype html>
9, ConstantConstant is also angular. The method in module constant (name, object), where name is the name of the constant, and object is the value of the constant, which we can write
Copy the code code as follows:
<!doctype html>
ANGULARJS Basic Syntax