2016-08-24 66 views
0

任何人都知道为什么child-view没有在下面的plunk中渲染?Angular 1.5.8:为什么ng-repeat的子组件不渲染?

https://plnkr.co/edit/NQU9fmRvGS3U0rLYSmKa?p=preview

基本上有这样的:

data = [...] 
parent-view data="$ctrl.data" 
    li ng-repeat="item in data" 
    child-view data="item" 
+1

在你view.js将父项定义为'.component()',而子项使用'.directive()' - 但使用'.component()'的语法。将孩子切换到'.component()'工作。 –

回答

1

像丹尼尔在他的评论中提到的,你需要你的.directive定义切换到.component

查看更新Plunkr:https://plnkr.co/edit/3FFjDMut4gfBLDYbg0fJ?p=preview

+0

谢谢!我错过了那个庞然大物。但是你的解决方案会导致我在根文件中遇到真正的问题.... angular.module('app.views',[]),然后是angular.module('app.views',[])子文件。更改为angular.module('app.views')。 –

+0

err,um('app.rootview',[])setter和('app.childView',[])setter –