Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
jfsiii opened this Issue · 2 comments

3 participants

John Schulz Jamie Hill David da Silva Contín
John Schulz

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.

David da Silva Contín
Collaborator

I'll close this issue due to inactivity. If it's still relevant, leave a comment and I'll reopen it.

This could be added as an overridable public function.

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.