我正在尝试在具有“ng-if”的图像上使用“ng-mouseover”指令并且它不起作用但是如果我使用“ng-show”指令它可以工作,每个人都可以告诉我为什么吗?还是 AngularJS 的问题?
在 AngularJS 文档中,我什么也读不到:https ://docs.angularjs.org/api/ng/directive/ngMouseover
吴秀
<button ng-show="true" ng-mouseover="countOne = countOne + 1" ng-init="countOne=0">
Increment (when mouse is over)
</button>
Count: {{countOne}}
ng-if
<button ng-if="true" ng-mouseover="countTwo = countTwo + 1" ng-init="countTwo=0">
Increment (when mouse is over)
</button>
Count: {{countTwo}}