It depends upon what you are trying to achieve, if you are not using controller As syntax, you would need $parent
to access the parent controllers
scope in a nested structure.
<div ng-controller="ParentController">
<div ng-controller="ChildController">
</div>
</div>
Then you can access the parent scope
as follows
function ParentController($scope) {
$scope.states= ["Chennai", "Kerala", "Spain"];
}
function ChildController($scope) {
}
Now you could do something from your view...
<div ng-app ng-controller="ParentController">
<div ng-controller="ChildController">
{{$parent.states}}
</div>
</div>
Now coming to case of your comment on a isolated scope, we could use $parent
to access the property in parent scope
but you could use the scope property (@ , = , &)
where you can specify which scope properties you need to work with.