2015-04-17 57 views
0

我正在研究具有動態生成的綁定,其中綁定本身是事先評估/計算的。例如:{{}}中綁定或嵌套{{}}中的動態變量名稱

<span ng-repeat="extra2 in product.extra2"> 
     <input type="checkbox" checkbox-group /> 
     <label>{{extra2.extra_0}}</label> //this complete work 
     <label>{{extr_price}}</label> //this not work 
    </span> 

它不起作用。

ngBindngBindTemplate沒有用。

控制器

$scope.extr_price = 'extra2.extra_0'; 

回答

0

應當{{extra2['extr_price']}}

和控制器: $scope['extr_price'] = $scope.extra2['extra_0'];

0

解決此它

controller: $scope['extr_price'] = 'extra_0'; 

view : {{extra2[extr_price]}}