How to increase the badge value? [Closed]


#1

How can i increase the badge value in tabs ?


#2

If you badge’s values are based on scoped data, all you need to do is have it update in your controller, then it should update.


#3

Like Mike says:

<div class="family-member" ng-repeat="member in home.familyMembers"">
  <div class="family-member-img"><img ng-src="{{'images/face-icons/' + member.icon}}" class="resize" /></div>
  <p class="family-member-label kit-text">{{member.calledName}}</p>
  <span class="badge badge-assertive home-page-badge" ng-show="member.badge > 0">{{member.badge}}</span>
</div>

Then, in the controller:

$scope.familyMembers[2].badge = 5;

#4

I need to increase the badge value in tabs ? The badge attribute in tabs
?


#5

For tabs, you’ve got to jump through a few hoops. You can’t put the badge on the generic scope in the tabs example. It has to go on a separate scope for each tab or on a higher level “app” controller.

See this for an explanation: Redraw tab badges on variable change?

Here is a working sample : http://codepen.io/calendee/pen/knyLj?editors=101

Go to the home tab. There’s an input there. You can change the value and the Home badge will update.


#6

ohk ! Got that ! Thank You !