AngularJS (4)
One: Scope of ANGULAJS scope
Scope (scope) is the link between HTML (view) and JavaScript (controller).
Scope is a JavaScript object with properties and methods that can be used in views and controllers.
Scope can be applied to views and Controllers.
The AngularJS application consists of the Following: $scope is a model
view, which is HTML.
Model (models), the data available in the current VIEW.
controller, the JavaScript function, can add or modify Properties.
As mentioned in the previous content, there is only one scope, but in large projects, there may be multiple scopes
As in the following example:
<div ng-app= "myapp" >
Two: root scope of ANGULARJS
All applications have a $rootScope that can function in all HTML elements contained in the NG-APP directive
$rootScope can act on the entire Application. is the bridge of scope in each controller. Values defined with Rootscope can be used in each controller.
As in the following example:
<div ng-app= "myapp" > Turn
AngularJS (4)