meteoric/meteor-ionic

ionTab unable to retrieve badge count variable from helper

lucnat opened this issue · 4 comments

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

Alt Text

Therefore, I cannot access the helper variable {{badgeCount}} there. And yes, the helper does exist.

+1 on this.

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

Oh...my bad. It works now, thanks!

This still is an issue .. I am just not able to get this to work ..
screen shot 2018-01-26 at 3 14 37 am

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.