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

v-get can't be used inside {{if}} #53

Closed
iivvoo opened this issue Oct 13, 2015 · 4 comments
Closed

v-get can't be used inside {{if}} #53

iivvoo opened this issue Oct 13, 2015 · 4 comments
Assignees

Comments

@iivvoo
Copy link

iivvoo commented Oct 13, 2015

 <div class="form-group {{if (v-get model property 'isInvalid') 'has-error' }}">
  <label for="email">{{label}}</label>
  {{input value=(mut (get model property)) placeholder=placeholder class='form-control' type=type}}
  {{#if (v-get model property 'isInvalid')}}
    <div class="error">
      {{v-get model property 'message'}}
    </div>
  {{/if}}
</div>

The (v-get) inside the class="" (first line) isn't handled properly, resulting in "A helper named 'v-get' could not be found"

The other cases (of course) work fine.

@rwjblue
Copy link
Member

rwjblue commented Oct 13, 2015

Thanks for reporting!

Demo JSBin here: http://jsbin.com/racogu/edit?html,js,output

@rwjblue
Copy link
Member

rwjblue commented Oct 13, 2015

@offirgolan - Looks like we need to also handle attributes?

@offirgolan
Copy link
Collaborator

Hmmm we already handle attributes (See here) but yeah this is a special case. Ill take a closer look into this.

@offirgolan
Copy link
Collaborator

Fixed with v2.0.1. Thanks for pointing this issue out!

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

3 participants