search

Home  >  Q&A  >  body text

javascript - Why do function parameters in Angularjs contain $?


What is the meaning of writing like this?

我想大声告诉你我想大声告诉你2694 days ago946

reply all(4)I'll reply

  • 迷茫

    迷茫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

    reply
    0
  • 大家讲道理

    大家讲道理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

    reply
    0
  • 给我你的怀抱

    给我你的怀抱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

    reply
    0
  • 三叔

    三叔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.

    reply
    0
  • Cancelreply