Manav Pandya
When to use prefix $ and when $$ in Angular?
By Manav Pandya in Angular on Oct 12 2018
  • Pooja Singh
    Apr, 2019 17

    The $ prefix is there to namespace Angular-provided services. To prevent collisions it's best to avoid naming your services and models anything that begins with a $.$$ prefix variable are treated as private variable, the reason behind adding $$ before the variable name is, that will avoid the internal variable conflicts and they wouldn't be exposed for external use.Like in angular you could find many of them, $$observers, $$watchers, $$childHead, $$childTail, $$ChildScope, etc

    • 0
  • Amit Prabhu
    Dec, 2018 25

    $ used prefix naming Convention while creating services $$ used prefix variable name as private variable

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS