jQuery click events not working with AngularJS

前端 未结 3 1051
醉酒成梦
醉酒成梦 2020-12-21 17:50

I am in the process of converting my multipaged php + jquery website into a single page angular app. However I have written a lot of code with jquery already so only intend

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-21 18:34

    Try using ng-click instead https://docs.angularjs.org/api/ng/directive/ngClick

    Then inside your controller simply declare the function

    myApp.controller('MyController', ['$scope', function($scope) {
      $scope.myFunction = function() {
        //Content here
      }
    }]);
    

    I know this doesn't really resolve the issue with jQuery but it helps to keep code all under one framework.

提交回复
热议问题