javascript - Why do function parameters in Angularjs contain $?
我想大声告诉你
我想大声告诉你 2017-07-04 13:44:37
0
4
967


What is the meaning of writing like this?

我想大声告诉你
我想大声告诉你

reply all(4)
迷茫

The naming of function parameters has nothing to do with the framework. You can understand the meaning of this function using your js syntax knowledge. In addition, I was also confused by this way of writing, so my suggestion is that if there is such a similar code, you can ignore it and find better code to learn

大家讲道理

$num is just a parameter naming convention and has no special meaning. $scope is the system function name of angular.js

给我你的怀抱

It is not necessary to add it. You can also change it to num. In many languages, $ is added to represent variables

三叔

The beginning of

$ means that this is the parameter provided by angular, and $$ means the internal variable of angular, which is just a naming convention of angular.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template