I wrote a directive, list
, that displays a list of items.
Then I wanted to reuse this component in another directive, wrapped-list
that would modify the list (add some items, change some values), and add some cosmetic stuff around it.
The list
expects a list of items as parameter, then, wrapped-list
expects the same list, plus the method that will change the list values and content.
The issue occurs when I try to invoke the method from wrapped-list
in order to pass the data to list
.
See fiddle here.
I tried many crazy combinations, and could not make it work.
items="listFactory({items:items})"
items="listFactory(items)"
items="{{listFactory(items)}}"
...
No luck so far. Any idea?
Note: I could make it work with items="$parent.listBuilder(items)"
, but I don't want to depend on the parent's scope.
Also, I know this will generate the $digest() iteration reached error
, which is not part of this question!