嗨我有嵌套数组如何获得嵌套数组的长度?它需要显示
答案 0 :(得分:0)
<div ng-repeat="movie in movies">
<div ng-repeat="actor in movie.meta.actors" >
<div ng-if="movie.meta.actors.length ==1"> Actor: <div>
<div ng-if="movie.meta.actors.length !=1"> Actors: <div>
<text>{{actor.name}}<text>
</div>
</div>
答案 1 :(得分:0)
尝试使用ng-switch
<div ng-repeat="movie in movies" ng-switch="movie.meta.actors.length > 1">
<div ng-repeat="actor in movie.meta.actors">
<div ng-switch-when="true"> Actors: <div>
<div ng-switch-default> Actor: <div>
<text>{{actor.name}}<text>
</div>
</div>
这是一个有效的jsfiddle http://jsfiddle.net/n3ekmpn6/