Loading jQuery after AngularJS

This question already has an answer here:

  • “Thinking in AngularJS” if I have a jQuery background? [closed] 15 answers

  • Inside your angular controller corresponding to that view, you can do the following:

    .controller('MyCtrl', [function($scope) {
        $scope.$on('$viewContentLoaded', function(){
            // here your jQuery code
        });
    }]);
    

    Few precisations: angular already has its builtin version of jQuery (jQlite) and you should use jQlite instead of jQuery every time that is possible. Moreover, you should avoid to use jQlite/jQuery snippets inside controllers and I am pretty sure that there is some "angularjs solution" which is more appropriate for your case.

    链接地址: http://www.djcxy.com/p/3922.html

    上一篇: 将JS和jQuery重新转换为AngularJS

    下一篇: 在AngularJS之后加载jQuery