1

What is the difference between

$scope.firstFunction = function($parameter) {
   //Any code
};

and

$scope.secondFunction = function(parameter) {
  //Any code
}

Thanks.

2
  • There is no difference, just a naming convetion. Also built-in Angular modules are prefixed with '$' sign. Commented Feb 3, 2015 at 8:12
  • You need to be a little more specific as to what those parameters actually are. Do both versions of this code actually work? Usually anything prefixed with $ is coming from angular such as $scope, $stateProvider so it SHOULD matter unless something is horribly misconfigurated. Commented Feb 3, 2015 at 8:13

1 Answer 1

2

Nothing but the name of parameter?

The only place in Angular, where parameters prepended with a $ matters, are where the Dependency Injector works. For instance in Controllers, Services, Directives etc..

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I was just confused on how to use the parameters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.