Angularjs : Show the count of new messages -


i working on chat application , there want show count of new messages.

    <div class="people"  >         <div ng-repeat="user in allcompanyusers">             <div class="person" ng-click="activatechat(user); bubble=true" id="chat_{{user.id}}">                 <img alt="" />                 <span class="name" >{{user.firstname}} {{user.lastname}}                 <span ng-if="!bubble" class="noti_bubble">{{count}}</span></span>                  <span class="preview"></span>             </div>         </div>     </div>        <div class="chat active-chat">             <div ng-repeat="c in activeconversations track c.time| orderby:'time':false">                 <div class="bubble" ng-class="c.type">                    {{c.message}} &nbsp;&nbsp;&nbsp;&nbsp;                    <span class="user_message">{{c.time | date:'yyyy-mm-dd hh:mm:ss'}}</span>                 </div>             </div>         </div> 

any kind of appreciated , in advance...

you can use {{activeconversations.length}} in order length/count as:

 <div class="people"  >     <div ng-repeat="user in allcompanyusers">         <div class="person" ng-click="activatechat(user); bubble=true" id="chat_{{user.id}}">             <img alt="" />             <span class="name" >{{user.firstname}} {{user.lastname}}             <span ng-if="!bubble" class="noti_bubble">{{activeconversations.length}}</span></span>              <span class="preview"></span>         </div>     </div> </div>    <div class="chat active-chat">         <div ng-repeat="c in activeconversations track c.time| orderby:'time':false">             <div class="bubble" ng-class="c.type">                {{c.message}} &nbsp;&nbsp;&nbsp;&nbsp;                <span class="user_message">{{c.time | date:'yyyy-mm-dd hh:mm:ss'}}</span>             </div>         </div>     </div> 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -