Skip to content
This repository

Track/notify/something unknown pragmas/tags/etc #239

Open
jfsiii opened this Issue · 1 comment

2 participants

John Schulz Jamie Hill
John Schulz
jfsiii commented

I'm working on a project where we would like to know what variables are referenced in a template, but are not present in a view object.

I think a user-supplied function is preferable, but I've only spent a little while with the code so I don't know the preferred method (call user-supplied function for each, store each a property, etc). Assuming you agree with the goal, just let me know the preferred approach and I'm willing to give it a go and submit a Pull Request.

Thanks,
John

Jamie Hill

I have a need for this also. I'm thinking a sort of "method_missing" implementation if you're familiar with Ruby.

So a template of {{foo}} - {{bar}}, with following view:

var view = {
  foo: 'ok',
  missing: function(key) {
    return: key + ' is unknown';
  }
};

...would result in ok - bar is unknown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.