I'm trying to stringify an object to json and pass it to a template. But instead I see whole object as a string rather than only what I want.
Code
Handlebars.registerHelper("GetFBUserDetails", function() {
var details = new Object({'fName' : firstName, 'lName' : lastName, 'pic' : pictureUrl});
return JSON.stringify(details);
});
<li>{{#GetFBUserDetails}}
{{fName}}
{{/GetFBUserDetails}}
</li>
I want only the firstname (fName) to be shown in li instead the whole object shows up as a string.