+ 1
$ sign
Hey there, I am learning both jQuery and angularjs and I am wondering what is the difference between the $ used on the jQuery and the one used on the angularjs. In angularJS it is commonly used on the $scope and the $http code when defining a controller now it is really confusing me.
4 Réponses
+ 3
A good one.
$ in jQuery, denotes that *jQuery* is being used.
Whereas, $scope in angularjs is an *object* which binds HTML and JavaScript together!
+ 1
@Thabo Roy
Using the code below, you could(not necessary anyways) write jQuery instead of $ symbol.
var jQuery = $; // $(jQuery) is assigned to jQuery variable
+ 1
in jQuery $ is just an alias for jQuery, so there is no need for extra declaration like Blue suggested.
EDIT: I found it here https://api.jquery.com/jquery.noconflict/ , but I am pretty sure it's mentioned almost all over the place.
0
So with jQuery you mean I can just write jQuery instead of the $?