I'm looking to access or manipulate a scope's grandparent without making things overly complicated. Leveraging the controller as syntax, I can reference the parent controller like so: this.applicationCtrl.something
with applicationCtrl > parent1Ctrl > child1Ctrl - siblingOfChild1Ctrl hierarchy.
For example, picture an applicationCtrl on the <body>
tag, alongside a side panel managed by sidePanelCtrl
and content controlled by contentCtrl
which has a nested contentChildCtrl
Utilizing the controller as model, it's easy to interact with the sidePanelCtrl
using this.sidePanelCtrl
. But what if I want to stick to using the $scope
?
This question arises when dealing specifically with contentChildCtrl
where directly accessing $scope.$parent.$parent
will only lead me back to the applicationCtrl
, skipping over the sidePanelCtrl
.