您可以添加ng-if="rpFilter.ResourcePlanID.value"
到image tag
.
仅当您在文本框中输入值时,这将使该图像可见。
<th style="width:90px">
<span>ID</span>
<img ng-if="rpFilter.ResourcePlanID.value" class="serverRP_ajax-loader" src="loader_green_32.gif" />
<input type="text" id="abc" ng-model="rpFilter.ResourcePlanID.value" />
</th>
这是一个工作示例
注意:如果您只想检查字段是否被修改,那么您需要使用$dirty
,为此您必须使用formtag
这是怎么回事,
您应该使用属性名称,
ng-if="myForm.resourceplanid.$dirty"
<form name="myForm">
<th style="width:90px">
<span>ID</span>
<img ng-if="myForm.resourceplanid.$dirty" class="serverRP_ajax-loader" src="loader_green_32.gif" />
<input type="text" name="resourceplanid" id="abc" ng-model="rpFilter.ResourcePlanID.value" />
</th>
</form>