$index of ngRepeat inside angularjs directive
Instead of scope.$parent.$index
you might consider passing $index as a directive attribute:
<li my-directive index="{{$index}}" ng-repeat="value in values">
Directive:
myApp.directive('myDirective', function() { return { replace: true, // transclude: true, scope: { index: '@' }, template: '<div>testing {{index}}</div>', link: function(scope, element, attrs) { // ... } }});