Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Transclude slot doesn't work as expected when outlet is in a <table> #15598

@cheapsteak

Description

@cheapsteak

Want to create a table component but still allow users to customize the rendering of each row

This does not seem to work

component('myTable', {
    transclude: {
      row: 'row',
    },
    replace: true,
    template: `
      <table>
        <tr ng-repeat="row in vm.rows" ng-transclude="row">
        </tr>
      </table>
    `,
  })
<my-table>
    <row>
        <td>this doesn't show up</td>
    </row>
</my-table>

The <row> tag ends up being rendered inside the <tr>, and <td>s are lost

image

The browser takes liberties with <tr> and <td> tags (seems to strip them out if they're not in the right place)

One way to solve would be if we could transclude <tr attribute-selector> and transclude: { row: '[attribute-selector]'}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions