For example, $scope.op = $('#box'), the two $ before and after belong to different libraries. . Will there be any problem
漂亮男人2017-06-14 10:52:38
No.
$ in jQuery is equivalent to
jQuery being a variable
$scope
in angular, $http
, etc. are also separate variableswhere $ is just a part of the variable name, such as
var $abc = 'abc'
where $ will not conflict with $
in jQuery
迷茫2017-06-14 10:52:38
$scope
and $
are two completely different variable names that have no relationship. . .
伊谢尔伦2017-06-14 10:52:38
No way~
$scope You can treat it as an object... $ It’s another object
like var abc=1; var a=2; There will be no conflict between these two objects.. .
阿神2017-06-14 10:52:38
The
$ in
$scope
is just a prefix of a variable and has nothing to do with $
. The $
in jQuery is a real variable.
给我你的怀抱2017-06-14 10:52:38
You can redefine a symbol for jQuery and release the control of $,
For example:
`var $j = jQuery.noConflict();
$j(".box").on("click",function(){ //code});
`