AngularJS : How do access parent controller's scope item from the child directive?
<p>My html view as below</p>

<p><strong>School.html</strong></p>

<pre><code>&lt;html&gt;
&lt;body&gt;
   &lt;div class="col-xs-9"&gt;
   &lt;!-- major bootstrap html code goes over here --&gt;
   &lt;/div&gt;

   &lt;div class="col-xs-3"&gt;
       &lt;!--Call to directive goes here--&gt; 
       &lt;div student-profile ngInit="studentId=profileId"&gt;&lt;/div&gt;
    &lt;/div&gt;
 &lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p><strong>Controllers:</strong>
SchoolController.js</p>

<pre><code>(function() {

 var app = angular.module("SchoolApp")

 var SchoolController = function ($scope,$rootScope,...)
   {
      $scope.profileId = myData.profileId;
   }
</code></pre>

<p>studentprofileController.js</p>

<pre><code>(function() {

 var app = angular
             .module("SchoolApp")
             .directive('studentProfile',studentProfileDirective)
      function studentProfileDirective(){
      return {  
           restrict :'AE',
           replace:'true',
           controller:studentProfileController,
           bindtocontroller:true,
           template:'student-profile.html'
      } 

studentProfileController.inject=['$scope','$rootScope',...];

function studentProfileController($scope,$rootScope,....)
       {
          var ProfileID = $scope.$parent.profileId;
           console.log("ProfileID",ProfileID);
       }  
   };
</code></pre>

<p>I have tried $scope.$parent.profileId which is not working. I am getting ProfileID as "undefined". how do i get the parent controller's scope item profileId in the child directive?</p>

<p>Its look like my body controller assign the profileId after my directive gets loaded. So when the first time, my directive loaded, it doesn't get any profileId from its parentscope. How do i do the later sync in that scenario?</p>