Created
April 29, 2014 18:48
-
-
Save digitalplaywright/11408682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper("ifData", function(property, fn) | |
{ | |
var context = (fn.contexts && fn.contexts[0]) || this; | |
var args = [property]; | |
var canAction = function(can_args) | |
{ | |
alert('I was called for '+can_args[0].get('id')); | |
return true; | |
}; | |
// Resolve actual values for all params to pass to the conditional callback | |
var normalizer = function() { | |
return Ember.Handlebars.resolveParams(context, args, fn); | |
}; | |
return Ember.Handlebars.bind.call(context, 'content', fn, true, canAction, normalizer, args); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ifData is not reevaluated when model is modified.