+ 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.

5th Feb 2018, 9:18 AM
Thabo Roy
Thabo Roy - avatar
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!
12th Feb 2018, 2:37 PM
777
777 - avatar
+ 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
9th Mar 2018, 5:24 AM
777
777 - avatar
+ 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.
9th Mar 2018, 5:33 AM
🤖 Basile Laderchi
0
So with jQuery you mean I can just write jQuery instead of the $?
9th Mar 2018, 4:11 AM
Thabo Roy
Thabo Roy - avatar