use existing table elements as selector
The table element doesn’t allow <table-line>
elements as children and the browser just removes them when it finds them. You can wrap it in a component and still use the allowed <tr>
tag. Just use "tr"
as selector.
using <template>
<template>
should be allowed as well but doesn’t yet work in all browsers. Angular2 actually never adds a <template>
element to the DOM, but only processes them internally, therefore this can be used in all browsers with Angular2 as well.
Attribute selectors
Another way is to use attribute selectors
@Component({
selector: '[my-tr]',
...
})
to be used like
<tr my-tr>