该组件在单独使用时工作得非常好。但是如果在 ng-repeat 下使用,则 DOM 不会使用获取的数据进行更新
.component('viewMore', {
templateUrl: '../components/clientAllData/clientAllData.html',
controller: viewMoreCtrl,
controllerAs: 'vm',
bindings: {
icon: '<',
clientId: '@'
}....
这就是我在 ng-repeat 中调用组件的方式:
<tr ng-repeat="cfClient in selectedPS.withCF track by $index">
<td>{{cfClient.name}}</td>
<td>{{cfClient.value | INR}}</td>
<td>{{cfClient.revenue | INR}}</td>
<td>{{cfClient.linked_cf}}</td>
<td>{{cfClient.linked_cfValue}}</td>
<td>
//view-more is my component
<view-more icon="true" client-id="{{cfClient.user_id}}"></view-more>
<i class="material-icons">not_interested</i>
</td>.....
*** 组件能够使用 获取数据client.user_id
,但它不会更新组件view-more
模式窗口内的数据。