Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : how do i access the data in the template?

$
0
0
this.info or info would work to access the info property of the hotspot. If you want to use livebinding, you'll want to use this.attr(...). Of course, if you are in a can.each, $.each or similar, the this keyword will point to something different. Hard to tell without seeing show.ejs.

One thing I see that may cause you grief later is using a non-standard service where each model is wrapped in the info property. Ideally, the instance should be an object and the first level of that object contains the id property. You'll want to override the Hotspot.model function using the instructions here under Non-Standard Services.


Viewing all articles
Browse latest Browse all 3491

Trending Articles