Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
AngularJS 嵌套指令插入到它们假定的父元素之外
使用 Angular 1.4 我遇到了同样的问题 - 但我也在尝试将行创建为 Angular 2 组件,所以我不能使用“replace:true”。
从 1 迁移到 2 时,这是否会成为问题? 如果是这样,我该如何解决?
您可以改用类或属性选择器
@Component({ selector: '[myTr]' template: `<td></td>` }) export class MyTr {}
然后像这样使用它
<tr myTr></tr>