更新时间:2022-06-27 00:20:29
您可以像这样直接在点击处理程序中检查停止标记":
You can check the 'stop flag' directly in your click handler like this:
<div ng-click="stopmyFunc1 === undefined && myFunc1()">
<!--some data here...-->
</div>
<button ng-click="stopmyFunc1 = true">Cancel</button>
因此,您无需在控制器中进行额外检查...
With that you don't need an additional check in your controller...