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 - Displaying JSON data posts for blog using just the post id -

docusignapi - Documents restrictions within a package -

javascript - angular.forEach loop with $http.get -