Take the 2-minute tour ×  I'm trying to find the best way to get
an index position within an ngRepeat used with a custom
directive. The problem I'm trying to solve is that for each
iteration of the ngRepeat, I'd like the option of knowing where
I am in the iteration so I can create a custom template based on
that index position.  Unless there is a better way of doing
this, I'm attempting to do this functionality based on this
documentation from directives:  & or &attr - provides a way to
execute an expression in the context of the parent scope. If no
attr name is specified then the attribute name is assumed to be
the same as the local name. Given and widget definition of
scope: { localFn:'&myAttr' }, then isolate scope property
localFn will point to a function wrapper for the count = count +
value expression. Often it's desirable to pass data from the
isolated scope via an expression and to the parent scope, this
can be done by passing a map of local variable names and values
into the expression wrapper fn. F