AngularDart: ng-switch in ng-repeat
-
02-01-2020 - |
Question
Can someone please explain to me why the following code is working in angular but not angularDart..?
<div ng-repeat='number in [1,2,3]' ng-switch on='number'>
<div ng-switch-when='2'>This is numer two!</div>
</div>
Thanks!
Solution
As I seems to me, the API for AngularDart doesn't have the on
attribute while the Angular API leaves the programmer the choice between using ng-switch on='...'
or ng-switch='...'
.
So for both, Angular and AngularDart, the following might work:
<div ng-repeat='number in [1,2,3]' ng-switch='number'>
<div ng-switch-when='2'>This is numer two!</div>
</div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow