Closed PaulGrimshaw closed 10 years ago
Those events fire every time a key is found. On Oct 28, 2013 4:05 PM, "Paul Grimshaw" notifications@github.com wrote:
Is it possible to have the PlaceholderFound event fire for {{#if...}}, {{#with...}} and {{#each...}} as well as normal placeholders? The current PlaceholderFound logic works great, but I can't seem to pick up whether a particular field is in the template if the field is ONLY in the {{#if tag.
— Reply to this email directly or view it on GitHubhttps://github.com/jehugaleahsa/mustache-sharp/issues/13 .
The example code below gives no results:
var keys = new List
Am I missing something? I am looking to pick up that the "Test" property has been accessed...
I will create a unit test from your example and see what is going on.
My bad, there is an event on the Generator
that says whenever a placeholder is replaced.
You are asking about the event on the actual FormatCompiler
.
Let me see what I can do.
I just created a new NuGet package that includes your requested changes. I created a couple of unit tests based on your example. Please let me know if you run into any problems. If everything looks good, please close this issue. Thanks!
Is it possible to have the PlaceholderFound event fire for {{#if...}}, {{#with...}} and {{#each...}} as well as normal placeholders? The current PlaceholderFound logic works great, but I can't seem to pick up whether a particular field is in the template if the field is ONLY in the {{#if tag.