Handlebars.Net
Handlebars.Net copied to clipboard
Question: Is there a way to get the name of the property passed to a helper?
Given the following code:
var data = new { myValue = "tEsT", otherValue= "tEsT" };
var template = "{{lowercase myValue}}";
Is there a way within a custom "lowercase" helper to the name of the property passed to the helper? In this case, I would want to get the name "myValue" from within the helper?
My goal is the be able to determine which fields are being used within the template so I know what data to provide the template for parsing.
Since the property name is known in the template, {{helper propertyName "propertyName"}} would achieve what you're describing.