Using mongo db data on helper


#1

I have a collection with a listing of homes and I can access the data in the template simply like {{title}}. I have a onrender helper of the template and want to use the title to perform some js actions. How can I access this as variable on the helper side.


#2

You could do something like

<li class="title-class">{{title}}</li>

in your template and access it with something like

"click .title-class" : function(){
 titlevar = this.text();
 ...
}

#3

@kamal Thanks for the reply Kamal! I was using vazco google map to show the map of each listing. Each of those had a field of lat and long on the database. I wanted to use the these values to change the map. Thus, I need to obtain those values from database on a onrendered helper.