8000 count returned by incrementCounter is undefined · Issue #5 · awwx/meteor-mongo-counter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
count returned by incrementCounter is undefined #5
Open
@ashersz

Description

@ashersz

Hi,
I am trying to add a memberid field with incrementCounter
I get: Error invoking Method 'getCount'
the count value is undefined
I am new to meteor and I could not find a full example with incrementCounter so I may have done something wrong.
Thanks for your help.

I have the following code
if (Meteor.isServer) {
Meteor.methods({
'getCount' : function () {
var count = incrementCounter('memberid');
console.log("count : "+count);
return count;
}
});
}
...
if (Meteor.isClient) {
...
Template.member.helpers({
steps: function() {
return [{
id: 'personal-info',
title: 'Personal Info',
schema: Schema.personalInfo,
// template: 'personalInfo'
}, {
id: 'member-info',
title: 'Member Info',
schema: Schema.memberInfo,
// template: 'memberInfo',
},{
id: 'contact-info',
title: 'Contact Info',
schema: Schema.contactInfo,
// template: 'contactInfo',
onSubmit: function(data, wizard) {
var self = this;
var count = Meteor.call('getCount');
var mydata = .extend(wizard.mergedData(),{memberid:count});
Members.insert(
.extend(mydata, data), function(err, id) {
if (err) {
self.done();
} else {
Router.go('viewMember', {
_id: id
});
}
});
}
}];
}
});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0