Is it possible to insert ng-switch-when the inside of ng-repeat ?
<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>
At startup, I received the following exception:
Error: Argument '?' is required pa@http ://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js:16 ...
Thanks!
EDIT
I am trying to do the following
<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>
So, I was wondering if I can use ng-repeat to help reduce the redundant HTML code ( ng-switch-when ) above.
source share