title: How to access parent component in angularjs 1.5
body: <p>Hi i am trying to display simple components in angularjs where child needs to access parent name.And my code goes like this:</p>
  
  <p>HTML file:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type='text/javascript' src='angular.min-1.5.0.js'&gt;&lt;/script&gt;
      &lt;script type='text/javascript' src='app.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body ng-app="componentApp"&gt;
      &lt;div ng-controller="helloCnt"&gt; 
          &lt;hello name="Parent"&gt;&lt;/hello&gt;
          &lt;hello1 name="Child"&gt;&lt;/hello1&gt;  
          &lt;label&gt;List: &lt;input name="namesInput" ng-model="names" ng-list=" | "   required&gt;&lt;/label&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>CODE:</p>
  
  <pre><code>app.component('hello', {
          transclude: true,
          template:'&lt;p&gt;Hello I am {{$ctrl.name}} and ctrl name is {{myName}}&lt;/p&gt;',
          bindings: { name: '@' },
          controller: function($scope) {
                          $scope.myName = 'Alain';
                          alert(1);
          }
  });
  
  app.component('hello1', {
          require: {
              parent: 'hello'
          },
          template:'&lt;p&gt;Hello I am {{$ctrl.name}} &amp;&amp; my parent is {{myNameFromParent}} &lt;/p&gt;',
          bindings: { name: '@' },
          controller: function($scope) {
                          $scope.myNameFromParent=this.parent.myName;
                          alert(2);
          }
  });
  </code></pre>
  
  <p>And it throws an error :</p>
  
  <p><code>TypeError: Cannot read property 'myName' of undefined</code></p>
  
  <p>I am not able to figure out what is wrong in the code and why it can't find the parent.Any inputs on the mistake I am making.Seems to be a small one I might have missed.</p>