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
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 byangular
, and$$
means the internal variable ofangular
, which is just a naming convention ofangular
.