I have a template
{{#each data}}
{{this}}
{{/each}}
Back
The data sent to the template using the helper is basically an array of strings from the following helper
'data': function( ){
var distinctOrgListing = _.uniq(MyCustomCollection.find({}, {sort: {orgName: 1}, fields: {orgName: true}}).fetch().map(function(x) { return x.orgName;}), true);
console.log("Listing.helpers: distinct listings :" +distinctOrgListing)
return distinctOrgListing;
}
This will return some data in the form of a list of strings. For example, when printing to the console, I will get
Listing.helpers: distinct listings: a,b,c< /pre>I want
>Send the value I received as a parameter to Iron Router so that I can use the value for collection search
My router configuration As follows:
this.route("listingbycompanyL1",{
path:"/listingL1",
layoutTemplate: ' ListingbycompanyL1',
data: function(){
var update=MyCustomCollection.find({orgName:"XXXX" }).fetch();
return {
update:update
};
}
});How to pass the value I received (a,b,c) to IR and use it to search, where XXXX Is a or b or c
p>
this.route("listingbycompanyL1",{
// specify the strategy _id as an URL component instead of query parameter
path:"/listingL1/: a",
layoutTemplate:'ListingbycompanyL1',
data: function(){
var update=MyCustomCollection.find({orgName: this.params.a }).fetch();< br /> return {
update:update
};
}
});
I am a newbie to meteor And have been trying to pass a value from an arraylist to an href pathfor element.
I have a template
{{#each data}}
{{this}}
{{/each}}
Back
The data sent to the template using the helper is basically an array of strings from the following helper
'data': function(){
var distinctOrgListing = _.uniq(MyCustomCollection.find({}, {sort: {orgName: 1}, fields: {orgName: true}}).fetch().map(function(x) {return x.orgName;}), true);
console.log("Listing.helpers: distinct listings :" +distinctOrgListing)
return distinctOrgListing;
}
This will return some data in the form of a list of strings. For example, when printing to the console, I will get
Listing.helpers: distinct listings: a,b,c
I want
>Send the value I received as a parameter to Iron Router so that I can use The value is set to search
My router configuration is as follows:
this.route("listingbycompanyL1",{
path:"/listingL1 ",
layoutTemplate:'ListingbycompanyL1',
data: function(){
var update=MyCustomCollection.find({orgName:"XXXX" }).fetch();
return {
update:update
};
}
});
How to pass the value (a,b,c) I received to IR and use it to search, where XXXX is a or b or c
This is a simple parameterized route:
< p>
this.route("l istingbycompanyL1",{
// specify the strategy _id as an URL component instead of query parameter
path:"/listingL1/:a",
layoutTemplate:'ListingbycompanyL1',
data: function(){
var update=MyCustomCollection.find({orgName: this.params.a }).fetch();
return {
update:update
} ;
}
});