angularjs - In angular js want to set init variable -


<body ng-app="d" ng-controller="con" ng-init="jj=''">     <section id="phase1">                 <div ng-repeat="obj in arr" >                     <div  ng-if="jj != obj.sentdate" ></div>                     <span  >{{obj.sentdate}}</span>    ///   how set jj value here date print once.                     <div >{{obj.msg}}</div>                 </div>             </section>   </body> 

this result

sat 14 2014 mookdsbg sat 14 2014 mookdsbg sat 14 2014 mookdsbg 

but want :

sat 14 2014 mookdsbg  mookdsbg  mookdsbg 

<section id="phase1">             <div ng-repeat="obj in arr" >                 <div  ng-if="jj != obj.sentdate" ></div>                 <span ng-show="jj != obj.sentdate" >{{obj.sentdate}}</span>    /// use ng-show                 <div >{{obj.msg}}</div>             </div>         </section>  

use ng-show first repeat


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -