我有這樣的孤立範圍指令:指令表裏面呈現的外部表
.directive('hello', function() {
return {
restrict: 'E',
replace: true,
template: '<h1>Hello Directive</h1>',
scope: {}
};
});
如果我把該指令表內,古怪的是,該指令被呈現在表外,甚至使用時作爲一個屬性:
<table>
<tr>
<hello></hello>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
</tr>
</table>
任何變通辦法?
我創建了一個Codepen來演示這個:http://codepen.io/jviotti/pen/AtnzJ/。
編輯:我試着在td
包裝h1
。它仍然呈現表外:
耶不創建一個自定義元素,使用類似'