In my AngularJS HTML code, I have the following:
<div ng-controller="myController">
<div ng-grid="myGrid"></div>
</div>
The ngGrid component creates a table-like structure with a viewport, rows, and cells, each having their own scope. Within one of these cells, I created a custom directive called <range>
, similar to the HTML5 <input type="number">
tag. The scope chain now looks like this:
myController -> ngGrid -> ngViewport -> ngRow -> ngCell -> range
My goal is to retrieve the value of the <input>
within the <range>
directive and pass it back to
myController</code in a reusable way, without explicitly calling <code>scope.$parent.$parent.$parent.$parent.$parent
. I've tried requiring the controller within the directive, as suggested in this post, but it didn't work. I also attempted expression binding from this egghead.io video without success. I'm stuck on how to proceed from here.