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

alpha.48: tbody should not wrap tr in template #5638

Closed
todoubaba opened this issue Dec 5, 2015 · 6 comments
Closed

alpha.48: tbody should not wrap tr in template #5638

todoubaba opened this issue Dec 5, 2015 · 6 comments
Milestone

Comments

@todoubaba
Copy link
Contributor

@Component({
  selector: 'my-cmp',
  template: `
  <table border>
    <thead>
      <th>col1</th>
      <th>col2</th>
    </thead>
    <tbody>
      <template ng-for #rx [ng-for-of]="values">
        <tr>
          <template ng-for #ry [ng-for-of]="rx">
            <td>{{ry}}</td>
          </template>
        </tr>
      </template>
    </tbody>
  </table>
  `
})
class MyCmp {
  values = [
    [11, 12],
    [21, 22]
  ];
}

table
Elements

http://plnkr.co/edit/ZXV6pLI44IqFQbIEX4zj?p=preview

@udos86
Copy link

udos86 commented Dec 5, 2015

Yep, recognized this one, too. Should not be a default behavior. It pollutes semantically correct table header markup and therefore quickly breaks anticipated rendering. Thanks for fixing!

@vicb vicb added this to the beta.0 milestone Dec 6, 2015
@vicb
Copy link
Contributor

vicb commented Dec 6, 2015

Two way we can fix this:

  • never explicitly add a <tbody>,
  • add a <tbody> only if the <tr> has a parent (ie is not a fragment).

The first solution would produce consistent result whether rows are in the master template or added as fragment.

@tbosch what do you think ?

@tbosch
Copy link
Contributor

tbosch commented Dec 7, 2015

Let's do it this way:
Never add an implicit parent when the parent element is a template element.

@cur3n4
Copy link

cur3n4 commented Dec 10, 2015

I am also experimenting the issue with tr in thead being wrapped with a tbdoy.

@cur3n4
Copy link

cur3n4 commented Dec 10, 2015

It doesn't happen in alpha 51. So all good

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants