Q:

How to get the parent(/parent/parent/..etc) controller from inside a directive? 

I have 3 directives, which structure might look something like this:
<my-component>
    <my-items>
        <my-item="item" ng-repeat="item in MyItems.items">
            {{ item.name }}
            <!--  item.children -->
            <my-items>
                <my-item="item" ng-repeat="item in MyItems.items" />
            </my-items>
        </my-item>
    <my-items>
</my-component>

where the depth of my-items can be infinite (in theory). 
Now I want to have the my-component hold the (ONE!)  item that the user selects and add a conditional selected class, so in (~pseudo) code which will look something like this:
<my-item="item" ng-click="myComponent.selected = item"
                ng-class="{ selected: myComponent.selected == item }" />

How can I know in here what the selected item is of the my-component? 
I have tried to do this in myItems directive:
// itemsComponentController is the controller of my-component
require: "^^itemsComponentController";

But angular here throws the error it cannot find such a controller.  What am I doing wrong here with the require?  Does it not find controllers that are not its direct parents? 
I have it working on emitting the 'item-selected' event, which is handled in the controller by doing the scope.$on("item-selected"), but then I still cannot know the myComponent.selected in <my-item>
See this jsfiddle for the (minimalistic?)  typescript version of this problem. 

A:

I found the issue! 
I don't have to require the controller's name, but instead require the directive's name.  Then the controller of that directive will be passed as variable in the link function:
// Require the name of the (parent) directive instead of its controller name
require: "^^myComponent";
link: function(scope, elem, attrs, ctrl) {
    // ctrl is the controller of <my-component>
    // so now I can do ctrl.itemSelected()
}

The working jsfiddle

