TutorialLesson 9Free preview
AngularJS Scopes
This lesson is part of AngularJS · All levels
Summary
$scope is the object that represents the model on an application part, whereas $rootScope is the parent scope of all. The scope is hierarchically linked so that the child can inherit the parent's property prototypically. Avoid accumulating too much data in the $rootScope to be easily maintained.
Key points
- $rootScope is the parent of all $scope
- The child's scope inherits the parent's scope property prototypically
- Making separate scope per section keeps the data isolated
- Too much use of the $rootScope makes treatment difficult.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.