当 i.typ 更改时,ng-switch 不会在下面的代码中更新。也许这与开关之外的 ng-repeat 有关?在页面重新加载时它有效,但在模型更改时无效。
<div id="sceneCtrl" ng-controller="SceneController">
<transform id="{{'annotation'+i.ID}}" ng-repeat="i in vm.sharedService.SceneAnnotations">
<group ng-switch on="{{i.typ}}">
<transform ng-switch-when="0" > [subtree 0...] </transform>
<transform ng-switch-when="1" > [subtree 1...] </transform>
</group>
</transform>
</div>