In my Angular application, I am utilizing ui-grid. I am looking to implement a custom action on a cell within the grid that will trigger a method from my app. Essentially, this involves calling a method located higher up in the parent hierarchy from a directive.
Currently, the approach for achieving this is by using something like: $scope.$parent.$parent.$parent.$parent.foo(). However, this method does not seem very elegant.
An alternative option would involve creating a recursive function that traverses the ancestry of the $scope. While this may provide a cleaner solution, it still feels somewhat unconventional.
Furthermore, I am questioning whether attempting to accomplish this type of functionality is considered good practice in Angular development.