【发布时间】:2017-07-05 20:01:41
【问题描述】:
您好,我有一个需要根据条件启用或禁用的按钮。 当它需要被禁用时,我需要显示一条消息。但是 Javascript 会触发很多次,因此消息在只需要显示一次时会显示多次。
以下是调用 Javascript 函数的标记:-
<button type="submit" class="btn btn-save nm" ng-click="controller.saveOpportunity()" ng-disabled="!(controller.canDealBeClosedByFeeAllocationStatus() && controller.isEnabled('SaveOpportunity'))">
<svg><use xlink:href="../Content/images/c/svg-defs.svg#circle-check"></use></svg>
Save
</button>
下面是Javascript函数:-
canDealBeClosedByFeeAllocationStatus:()->
if this.isReibDeal() && this.data.OpportunitySalesStageIsClose() == true
if this.data.FeeAllocationComplete == false
ShowMessage('warning', 'Fee Allocation needs to be complete')
return this.data.FeeAllocationComplete
else
return true
这个问题的解决方法是什么?
【问题讨论】:
标签: angularjs html coffeescript