I know ng-switch-when
expects a value, but I created a ng-repeat
with it.
What do I need to make for this to work?:
<div ng-switch-when="2" ng-controller="pages as page" ng-switch="page.get()">
<div ng-repeat="i in [1,2,3,4,5]">
<div ng-switch-when="{{ i }}">
{{i}}
</div>
</div>
<button ng-hide="page.is(1)" ng-click="page.prev()" class="btn btn-info">Previous Page</button>
<button ng-hide="page.is(5)" ng-click="page.next()" class="btn btn-info">Next Page</button>
<br>
<label>Page {{page.get()}}</label>
</div>
I want to show the div
when the value is "i", but angularjs doesn't accept that.
I don't know if that makes much difference, but I'm using a
ng-switch
inside adiv
which is being displayed by anotherng-switch
.
Thanks in advance
EDIT 1: I want to create with a
ng-repeat
5 pages, which are inside a ng-switch. When the repeat "i" value is one, I want the page it created to be displayed when the switch value equals one, also, and that for the rest of them