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> 

code in plunker

print object or 0 instead

  <article>     {{item[2].tc || 0}}   </article> 

or

  <article>     {{item[2].tc ? item[2].tc : 0}}   </article> 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -