angularjs组件的子级

angularjs组件的子级,angularjs,controller,angularjs-scope,components,parent-child,Angularjs,Controller,Angularjs Scope,Components,Parent Child,angularjs组件的子DOM如何访问组件的变量值 为了说明,我使用angular官方网站的第一个组件示例。我在组件中添加了一个div <span>Name: {{$ctrl.hero.name}}</span> <!--The following is the child of the component, which is not showing component's variable as expected --> <div ng

angularjs组件的子DOM如何访问组件的变量值

为了说明,我使用angular官方网站的第一个组件示例。我在组件中添加了一个div

<span>Name: {{$ctrl.hero.name}}</span>

<!--The following is the child of the component, 
    which is not showing component's variable as expected  -->
<div ng-controller="InnerCtrl">
  Inside the component, Name: {{$ctrl.hero.name}}
</div>
Name:{{$ctrl.hero.Name}
在组件内部,名称:{{$ctrl.hero.Name}

这是注释行
console.log('InnerCtrl,ctrl.hero=',ctrl.hero')它会工作的。谢谢你,dfsq!它的作品后,我评论了!但我也需要在控制器中使用ctrl.hero对象。如何在内部控制器innerCtrl中引用英雄对象?