是否可以在ng-repeat内部嵌套ng-switch-when?
<div ng-controller="UserController">
<div ng-switch on="renderPath">
<div ng-repeat="route in routes">
<div ng-switch-when="route.path">
<div ng-include src="route.url"></div>
</div>
</div>
</div>
</div>
运行时出现以下异常:
Error: Argument '?' is required
pa@http://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js:16 ...
<!-- ngSwitchWhen: route.path -->
谢谢!
编辑
我想要完成的是以下
<div ng-switch on="renderPath">
<div ng-switch-when="path1">
<div ng-include src="url1"></div>
</div>
<div ng-switch-when="path2">
<div ng-include src="url2"></div>
</div>
<div ng-switch-when="path3">
<div ng-include src="url3"></div>
</div>
</div>
</div>
所以我想知道我是否可以使用ng-repeat来帮助减少上面多余的 HTML 模板代码(ng-switch-when)。