Skip to content

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

Closed

Description

@todoubaba
@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

Activity

  1. udos86 commented on Dec 5, 2015

    @udos86

    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!

  2. added this to the beta.0 milestone on Dec 6, 2015
  3. vicb commented on Dec 6, 2015

    @vicb
    Contributor

    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 ?

  4. tbosch commented on Dec 7, 2015

    @tbosch
    Contributor

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

  5. added 3 commits that reference this issue on Dec 7, 2015
    6395b6a
    4811dc6
  6. cur3n4 commented on Dec 10, 2015

    @cur3n4

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

  7. cur3n4 commented on Dec 10, 2015

    @cur3n4

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

  8. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions