scalaGirl
scalaGirl

Reputation: 435

Angular: The $ in scope variables

I cannot find any documentation regarding the proper use of $ in scope variables. My code runs fine without them and the closest answer google gave was that it is a convention used by JQuery programmers.What are the best practices and when should it be used in Angular?

Upvotes: 0

Views: 66

Answers (1)

Everton Yoshitani
Everton Yoshitani

Reputation: 946

You can find more details in here: http://docs.angularjs.org/guide/concepts#angular_namespace

Angular Namespace To prevent accidental name collision, Angular prefixes names of objects which could potentially collide with $. Please do not use the $ prefix in your code as it may accidentally collide with Angular code.

Upvotes: 3

Related Questions