我正在使用Angular1.7.x。我想将2个输入字段的常见内容移至一条指令以减少样板。有没有办法为此创建自定义指令?
<tbody>
<tr ng-repeat="obj in advHistoryList"
<td class="lh-adv-hist-td" ng-if="isFlagTrue">
<input
type="image"
class="global-icon global-icon-edit"
value = "{{obj.comment}}"
title={{HOVER_FOR_DETAILS}}
ng-disabled="isThisSelected(obj.id)"
ng-show="obj.hastext"
my-hover-directive />
<input
type="image"
class="global-icon global-icon-add"
value = "{{obj.comment}}"
title={{OVER_FOR_DETAILS}}
ng-disabled="isThisSelected(obj.id)"
ng-show="obj.addText"
my-hover-directive />
</td>
</tr>
</tbody>