I've got the following AngularJS HTML code:
<div ng-controller="myController">
<div ng-grid="myGrid"></div>
</div>
ngGrid creates a structured table-like component out of a viewport, a series of rows, and cells within those rows. Each of those items has their own scope. In addition, I created my own directive in one of those cells, a <range>
directive similar to the new HTML5 <input type="number">
tag. So the scope chain looks like this:
myController -> ngGrid -> ngViewport -> ngRow -> ngCell -> range
what I'm trying to do is grab the <input>
's value from within the <range>
directive and pass that along to myController
in a reusable way (in other words, NOT explicitly calling scope.$parent.$parent.$parent.$parent.$parent
so my directive can be reused in other scenarios).
I tried requiring the controller within the directive code as directed by this post but to no avail. I've also tried expression binding as directed by this egghead.io video and still no success. Really not sure how to proceed from here.