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

Using parent access in with + if doesn't work correctly #50

Open
Toverbal opened this issue Mar 13, 2018 · 0 comments
Open

Using parent access in with + if doesn't work correctly #50

Toverbal opened this issue Mar 13, 2018 · 0 comments

Comments

@Toverbal
Copy link

Toverbal commented Mar 13, 2018

I can't really explain what's wrong, but an example will probably say enough. Here's a complete fiddle: https://jsfiddle.net/Toverbal/7gc9br80/

Data:

var data = {
  level1: {
     level2: 'This is level 2!',
  },
  withwrapper: {
    content: 'This is dummy content',
  },
};

Template (this is just a snippet from the complete fiddle!):

  {{#with withwrapper}}
    {{#if ../level1}}
      <div>This fails: {{ ../level1.level2 }}</div> 
    {{/if}}
  {{/with}}

Strange thing is that ../../level1.level2 will give result and if you don't add the #if, the ../level1.level2 actually works.

@Toverbal Toverbal changed the title Using parent access in with + if Using parent access in with + if doesn't work correctly Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant