Does anyone know if the reasoning behind the use of dollar methods and variables in angularJS is to instruct angularJS to avoid checking those values when a digestion is going on? So, if angular comes across $scope.$value and $scope.value, then it will avoid checking the former since it’s prefixed with a dollar character in its variable name?
Does anyone know if the reasoning behind the use of dollar methods and variables
Share
There are a few times Angular ignores variables prefixed with the dollar sign:
When using the
{{ }}directive, angular will not show nested$variables. For example this only displays the
visibleproperty.Additionally when adding an explicit watcher on a scope object, changes to properties with a leading dollar sign of this object will not trigger the watcher. See this updated fiddle.
angular.equals()ignores keys prefixed with$.