Angular table row directive not rendering inside table

后端 未结 3 1841
有刺的猬
有刺的猬 2020-12-10 10:34

I am trying to add a row \"isrcrow\" directive to a table as follows:

 as the root template node will result in invalid markup, giving rise to the incorrect rendering of the row.

However, for those using a version of Angular prior to 1.2.13 (romantic-transclusion), this solution will not be applicable due to an issue that has been noted.

A work around would be to instead to use the directive as an attribute (i.e. restrict: 'A') and appropriately modify the template such that

is no longer the root template node. This will allow replace: true to be used.

提交回复
热议问题
3条回答
  •  轮回少年
    2020-12-10 11:21

    Adding a summary of my comments as an answer since it appeared to have helped the OP. :-)

    As GregL points out, omitting replace: true in a directive with restrict: 'E' and