1

For some reason the id in <div class='popup' id = '{{$index}}' is wrong inside its directive.

How can i manually $compile the id of an element?

.directive('repeater', function() {

var linkFn = function(scope, element, attrs){
  var id = $(element).attr('id');
  alert(id);
Sangram Singh
  • 7,161
  • 15
  • 50
  • 79
  • 1
    possible duplicate of [{{$index}} of ng-repeat computed after linker function of angular directive. $compile it?](http://stackoverflow.com/questions/19254705/index-of-ng-repeat-computed-after-linker-function-of-angular-directive-co) – Jason Goemaat Oct 08 '13 at 22:10
  • I think you're getting the index of the element after it's been rendered if in the template you did {{$parent.$index}} I bet it would give you the right index – btm1 Oct 13 '13 at 20:29

0 Answers0