AngularJS ng-click fires twice

后端 未结 18 1817
死守一世寂寞
死守一世寂寞 2020-12-03 07:10

I am using ng-click and it fires twice when I apply it to SPAN tag.

HTML

18条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 07:53

    was facing same issue. Find out they were using https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js version and i switch it to latest 1.4.5 version and it just worked.

    https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js

    var app = angular.module('regApp', []);
    
    app.controller('RegistrationCtrl', ['$scope','$http',function($scope,$http ) {
      $scope.PostRegistration = function() {
        alert('click '); // <--- fires twice
        /// some code here -- 
      };
    }]);
    
    

    Registration for {{data.EventName}}

    Save

提交回复
热议问题