I'm new in meteor.js and i'm practising building a simple and little app. My question is how to use the template data get from mongodb in templates inside. This is the structure:
router.js
Router.route('/point/:_id', {name: 'pointDetail', data: function() {
return InterPoints.findOne(this.params._id);
} });
template pointDetail.html
<template name="pointDetail">
<some tags>
{{datathree}}
</some tags>
{{> map}}
</template>
template map.html
<template name="map">
<div class="map-container">
{{> googleMap name="exampleMap" options=exampleMapOptions}}
</div>
</template>
map.js
Template.map.helpers({
exampleMapOptions: function() {
// Make sure the maps API has loaded
if (GoogleMaps.loaded()) {
// Map initialization options
return {
center: new google.maps.LatLng(coordX, coordY),
zoom: 8
};
}
}
});
I want to fill coorsx and coordy in map.js using the data I'm retrieving from the router. Someting like coordx = {{coordsx}} It is possible?
Thanks a lot.