2012-09-10 62 views
1

我有這個簡單的代碼。問題是"ng-switch-when"不顯示,這意味着column.stage沒有被正確渲染,雖然我試圖顯示{{column.stage}},並顯示正確的值(1或2或3 ...)ng-switch-ng-ng-repeat的值不顯示值

<div class="column span3" ng-repeat="column in columns"> 
    <h1>{{column.title}}</h1> 
    <div class="row" ng-repeat="shot in shots" ng-switch on="shot.stage"> 
     <h6 ng-switch-when="{{column.stage}}">{{shot.title}}</h6> 
    </div> 
</div> 

回答

0

您需要把ng-switch on =「shot.stage」放在它自己的元素中,例如:

<div class="column span3" ng-repeat="column in columns"> 
    <h1>{{column.title}}</h1> 
    <div class="row" ng-repeat="shot in shots"> 
     <div ng-switch on="shot.stage"> 
      <h6 ng-switch-when="{{column.stage}}">{{shot.title}}</h6> 
     </div> 
    </div> 
</div> 
+1

我不認爲我們可以把變量放在'ng-switch-when'。不幸的是。 –