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

Check template contents are valid for root #142

Open
MeirionHughes opened this issue Dec 5, 2016 · 2 comments
Open

Check template contents are valid for root #142

MeirionHughes opened this issue Dec 5, 2016 · 2 comments

Comments

@MeirionHughes
Copy link
Contributor

MeirionHughes commented Dec 5, 2016

given a html container,
when it has a <template> child
then ensure that the template has a template-controller
and ensure contents are valid for the root html container.

example:

<select>
  <template if.bind="foo">
    <template repeat.for="item of items">
       <option ... ></option> <!-- OK -->
       <div ...></div> <!-- INVALID -->
    </template>
  </template>
</select>

should report that <div> is not a valid child of <select>

<select>
  <template> 
     ...
  </template>
</select>

should warn that the template won't be activated in aurelia

@zakjan
Copy link

zakjan commented Dec 5, 2016

+1

Just a note, if.bind and repeat.for are not allowed on the same element, because their order is undefined. They need to be nested.

@MeirionHughes MeirionHughes changed the title Check template contents are valid for parent Check template contents are valid for root Dec 5, 2016
@MeirionHughes
Copy link
Contributor Author

Good point; It'll have to check through nested templates.

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

2 participants