Closed nodesocket closed 11 years ago
Are you sure? Here's a JSFiddle with it working: http://jsfiddle.net/VzkRs/1/
Perhaps you need to upgrade the library?
I am using:
DEBUG: ------------------------------- lib-dev.js:10269
DEBUG: Ember.VERSION : 1.0.0-rc.3 lib-dev.js:10269
DEBUG: Handlebars.VERSION : 1.0.0-rc.3 lib-dev.js:10269
DEBUG: jQuery.VERSION : 1.9.1 lib-dev.js:10269
DEBUG: -------------------------------
Still seeing this bug. If I simply hard code:
{{#if_gt 5 compare="10"}}
...
{{/if_gt}}
That works. Could it be related to the fact that we are using the following structure:
//total_transactions length is 5
{{#each transaction in transactions }}
...
{{else}}
...
{{/each}}
{{#if_gt total_transactions compare="10"}}
...
{{/if_gt}}
Still getting into the if_gt
block.
Is total_transactions
a number? Is it definitely what it appears to be?
eg. create a log helper:
Handlebars.registerHelper('log', function(input) { console.log(input); });
And then {{log total_transactions}}
where you need it.
Just confirmed, it is undefined
. Darn this is a problem.
What might be happening is when the template is rendered total_transactions
is undefined, it is being set in the model
with:
reopenClass({ })
Is there a work around for this?
reopenClass
is an Ember method, right? I don't have any experience with it, so I couldn't say. I'm not sure if Ember somehow uses Handlebars differently?
Sorry I can't be of any more help.
I am using a simple greater than if statement:
But I am always getting into the if statement, even though
total_transactions
is less than 10.Any ideas?