I have my default gridOptions in a parent controller.
EG:
$scope.gridOptions = {
rowHeight:50,
headerHeight:50,
onRegisterApi = function(gridApi,$scope){...}
}
The child controllers that implement UI-Grids all inherit the parent $scope and that seems to work fine for props with primitive types.
But, in the onRegisterApi
function, I need to be able to access local variables and methods that are not in the parent scope.
I'm pretty sure I need to use a JS Inheritance pattern, but I'm having a hard time making it work. I've checked out: http://blog.mgechev.com/2013/12/18/inheritance-services-controllers-in-angularjs/ and https://www.exratione.com/2013/10/two-approaches-to-angularjs-controller-inheritance/