Friday, May 17, 2024
147
rated 0 times [  148] [ 1]  / answers: 1 / hits: 39344  / 13 Years ago, wed, january 25, 2012, 12:00:00

I want to do something like this:



{{user.name.toLowerCase()}}


but I get this error:



Error: Parse error on line X:
...tatus {{user.name.toLowerCase()}}>
-----------------------^
Expecting 'ID', got 'undefined'

More From » handlebars.js

 Answers
25

I created the following helper, but I'm curious if there's a better solution out there.



Handlebars.registerHelper('toLowerCase', function(value) {
if(object) {
return new Handlebars.SafeString(value.toLowerCase());
} else {
return '';
}
});

[#87798] Tuesday, January 24, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaquelineh

Total Points: 360
Total Questions: 105
Total Answers: 114

Location: Saint Pierre and Miquelon
Member since Fri, Jan 28, 2022
2 Years ago
;