Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow templates to access templateOpts via a string #40

Open
earobinson opened this issue Nov 7, 2018 · 3 comments
Open

Allow templates to access templateOpts via a string #40

earobinson opened this issue Nov 7, 2018 · 3 comments

Comments

@earobinson
Copy link
Owner

earobinson commented Nov 7, 2018

We could use a format like:

{
  tag: '#.tags[_id].name'
}

this would be the same as:

{
  tag: ({ object, templateOpts }) => templateOpts.tags[object._id].name
}
@earobinson
Copy link
Owner Author

other formats we could use are

{
  tag: '#tags[_id].name'
}

or even

{
  tag: 'templateOpts.tags[_id].name'
}

@Abhijith1995
Copy link

I personally prefer the first option since # can be a direct sub for templateOpts which makes it a bit easier to reason about in my head. But the second option's more consistent.

@iain8
Copy link

iain8 commented Nov 7, 2018

hmm i think i agree, i like the #. whereas templateOpts seems like more of an arbitrary string to remember

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants