1

我有这个简单的代码。问题是"ng-switch-when"没有显示,这意味着column.stage没有正确呈现,尽管我尝试显示{{column.stage}}并且它显示了正确的值(1 OR 2 OR 3 ...)

<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>
4

1 回答 1

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>
于 2012-12-03T11:10:52.573 回答