I have seen this question but I am after something different - I don't want to have to create named properties on a service for the data I want to pass to a controller.
I have a service that provides an array of items, and each item in the array, is itself an array.
I pass the main array to a root controller (or directive) using a service, that's fine. After that I want to iterate each item in the array and create a directive with a controller for each item - how do I pass the item into this nested controller? It needs to be dynamic, obviously, because I don't know the number of items in the array.
If I wrap the nested controller in a directive, can I do it via the directive's scope?
Edit:
I need to iterate my items and pass each one into a nested directive or controller. So can I do something like this (in pseudo code)?
<mydirective>
<ng-repeat item in arrayOfItems>
<mynesteditemdirective>
<mycontroller>