In Angular 1.2, the element inside ngRepeat can see the parent scope's 
function(isConvoTabActive). However, after I switch to 1.3, this is no 
longer working. I checked the migration guide but found nothing. How can I 
fix this without using $parent.isConvoTabActive?

app.directive('myDirective',function(){
  return {
    restrict: 'E',
    scope: {
    },
    controller: ["$scope", "$element", "$attrs",
      function($scope, $element, $attrs) {
          $scope.isConvoTabActive = function(convoId) {           
            return convoId == $scope.indexes.activeConvoId;
          };
      }
    },
    template: "<div ng-repeat='(convoId, convo) in convos'>" +
                  "<div ng-if='isConvoTabActive(convoId)'></div>" +
              "</div>",
    replace: true, // replace the directive element
    link: function (scope, element, attrs) {
            scope.indexes = {
                "activeConvoId": "111"
            };
            scope.convos = {
               "111": {
                 "title": "convo 111" 
               },
               "222": {
                 "title": "convo 222"
               }
            };
    }       
  }})

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to