What is the meaning of writing like this?
迷茫2017-07-04 13:46:37
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
大家讲道理2017-07-04 13:46:37
$num is just a parameter naming convention and has no special meaning. $scope is the system function name of angular.js
给我你的怀抱2017-07-04 13:46:37
It is not necessary to add it. You can also change it to num. In many languages, $ is added to represent variables
三叔2017-07-04 13:46:37
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
.