[英]event not defined in firefox but working on chrome
我有以下功能:
$scope.getBillDetails=function($event){ bill_id=event.target.id
我在ng-click上以以下方式調用它:-
<td><button type="button" id="{{user.bill_id}}" href="#mySlider2" data-slide="next" class="btn btn-primary right" ng-click="getBillDetails($event)">View Details</button></td>
我的代碼在Chrome上運行正常,但在Firefox中失敗,提示未定義事件。 有人可以幫我嗎。 我看到了有關同一問題的其他一些帖子,但沒有得到任何適當的解決方案。
使用您命名為$event
的參數
更改
$scope.getBillDetails=function($event){
bill_id=event.target.id
至
$scope.getBillDetails=function($event){
bill_id=$event.target.id
// ^^ matches function argument
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.