ionTab unable to retrieve badge count variable from helper
lucnat opened this issue · 4 comments
lucnat commented
This was asked before here and here, yet it was never solved. Let me state the problem again:
{{#ionTabs style="ios" class="has-badge"}}
{{> ionTab title="Notifications" path="notifications" badgeNumber="{{badgeCount}}" iconOn="ios-bell" iconOff="ios-bell-outline" class="tab-item-positive notificationstab" }}
{{/ionTabs}}
gives me
Therefore, I cannot access the helper variable {{badgeCount}} there. And yes, the helper does exist.
fishdude commented
+1 on this.
daveeel commented
You have to make 'badgeCount' a template helper function name which returns the number.
Attribute value like {{badgeCount}} won't expanded
That means ... badgeNumber=badgeCount
lucnat commented
Oh...my bad. It works now, thanks!
chansdad commented
This still is an issue .. I am just not able to get this to work ..
I have the main template tabs and in that
<template name="tabs">
{{#ionTabs style="ios" class="has-badge"}}
{{> ionTab title="alerts" path="useralerts" badgeNumber="{{useralertcount}}" iconOff="android-notifications-off" iconOn="android-notifications" class="tab-item-positive"}}
{{/ionTabs}}
</template>
and i made the helper function useralertcount as
Template.tabs.helpers({
'useralertcount': function () {
return Useralerts.find({}).count();
}
});
why is it that i am seeing the curly's and not hte actual badge count? Appreciate the help.