Given the following why does the directive's $parent.$id equal the 
controller's $id? I though isolate scopes did not inherit prototypically.:

*JS*:

var app = angular.module('myApp', []);

app.directive('myDirective', function() {
  return {
    restrict: 'E',
    templateUrl: 'my-directive.html',
    scope: {}
  };
});

function myController($scope) {
  
}


* HTML:*

<div>
    <div ng-controller='myController'>
      (myController) 
      Id: {{$id}} 
      ParentId: {{$parent.$id != undefined && $parent.$id || 'None'}}       
  
      <my-directive></my-directive>
    </div>
  </div>
   
    
    <script type="text/ng-template" id="my-directive.html">
    <div>
      (my-directive)
      Id: {{$id}} 
      ParentId: {{$parent.$id != undefined && $parent.$id || 'None'}}     
    </div
    </script>

-- 
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/groups/opt_out.

Reply via email to