HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Scope (scope) is used in the link HTML (View) and JavaScript (controller) between.
Scope is an object, methods and properties are available.
Scope can be used in the view and controller.
When you create controller AngularJS, you can$ scope object as an argument:
Controller attributes corresponding to the attributes view on:
When adding$ scope objects in the controller, the view (HTML) can get these properties.
View, you do not need to add$ scope prefix, you only need to add an attribute name, such as:{{carname}}.
AngularJS application consists of the following:
scope the model.
scope is a JavaScript object properties and methods with these attributes and methods can be used in views and controllers.
If you change the view, model and controller will be updated:
Understand the scope you are currently using is very important.
In both instances, there is only one scope scope, so the process is relatively simple, but in large projects, HTML DOM has multiple scopes, then you need to know the scope of the corresponding scope is what you use One.
When we useng-repeat command, have visited each duplicate of the current duplicate object:
Each<li> element can access the current duplicate objects, here is a corresponding string, and variable xindicates.
All applications have a$ rootScope, it is applied to all HTML elements ng-appdirective contains.
$ rootScope can act on the entire application.Each controller is in the scope of the bridge. Rootscope with the value defined in each controller can be used in.
When you create a controller to $ rootScope passed as a parameter can be used in the application: