dipesh
1
Hello everyone
I was trying for display the entire object (or some array) in the spacebar template ( of course of debugging purpose).
I wanted to get some quick answers if there is anything equivalent
Somewhat similar to json filter in angularjs template {{ object | json }}
shock
2
I am not aware of any. Just standard iterating over Object.keys
dipesh
3
Came up with some solution:
Template.registerHelper('json', function(a) {
try{
return JSON.stringify(a);
}catch(e){return a;}
});
Usage in the template:
{{ json currentUser }}
Not sure if this is the best way though!
2 Likes
hassy84
4
I love it!! It would be quite usefull.