You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The template.instance().data.id property in the ionModal template helper is of type Number instead of String:
Template.myModal.helpers({
event: function () {
var template = Template.instance();
// The following shows the id property to be of type Number instead of String
console.log( template.data.id );
// Which means that something like this does not work
return myCollection.findOne({_id: template.data.id});
// The above does work if the document _id contains at least 1 alpha character
// Which means that you need to do this instead
return myCollection.findOne({_id: template.data.id.toString()});
}
});
The text was updated successfully, but these errors were encountered:
Summary
When using ionModal, meteor-iconic appears to converting the document
_id
to a Number if it comprises only numeric digits.Example
Given the following URL
http://host/test/1
for document{ _id: "1" [, ...] }
A page template of:
An ionModal template of:
The
template.instance().data.id
property in the ionModal template helper is of type Number instead of String:The text was updated successfully, but these errors were encountered: