Google News
logo
Angular - Interview Questions
Explain the concept of scope hierarchy ?
The $scope objects in Angular are organized into a hierarchy and are majorly used by views. It contains a root scope which can further contain scopes known as child scopes. One root scope can contain more than one child scopes. Here each view has its own $scope thus the variables set by its view controller will remain hidden to the other controllers. The Scope hierarchy generally looks like:

Root $scope

$scope for Controller 1
$scope for Controller 2
..
$scope for Controller ‘n’
Advertisement