javascript - AngularJS ng-repeat print 0 if any object missed -
one object missed in 2nd array. using ng-repeat there want print 0. please find below code
<div ng-repeat="item in items"> {{item}} <div> <h3>{{item[0].name}}</h3> <div> <article> {{item[0].tc}} </article> <article> {{item[1].tc}} </article> <article> {{item[2].tc}} </article> </div> </div> </div>
print object or 0 instead
<article> {{item[2].tc || 0}} </article>
or
<article> {{item[2].tc ? item[2].tc : 0}} </article>
Comments
Post a Comment