I have a directive that creates a row in a table. I then use ng-repeat to iterate over a list of items to populate the table with the directive row, e.g.:
<tr ng-repeat='item in items' rowItem='item' />
I am having a problem defining the scope.
I can't use scope: false because that does not separate the rowItem values.
I want to be able to bind to the rowItem value so using an isolated scope: scope:{rowItem: '='} which works as I want, but I still want the parent scope values to be accessible.
So the best choice would be scope: true however, I can't bind the scope to the row item.
I tried using attrs.$observe('rowItem', ...) but this does not fire when the list of items changes because the rowItem is not an interpolated attribute.
Is there a way to use a new child scope (scope: true) that can bind to an attribute (like it does in the isolated scope)?
You observer like this scope.watch(attrs.rowItem,function)