Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the undocumented features of Angular? [closed]

Tags:

angularjs

The Angular documentation is missing a few things. Can someone summarize what the undocumented features are?

like image 972
Mark Rajcok Avatar asked Feb 05 '13 04:02

Mark Rajcok


People also ask

What is Angular and its features?

Angular is an open-source, JavaScript framework written in TypeScript. Google maintains it, and its primary purpose is to develop single-page applications. As a framework, Angular has clear advantages while also providing a standard structure for developers to work with.

What is the problem with Angular?

Angular insufficiently caters to frond-end sensibilities, so many front-enders tend to ignore it. Back-enders do not have these problems. They have no preconceived notion of how front-end code is supposed to work, and aren't trained to recognise Angular's performance problems.


1 Answers

Angular 1.0.5 and 1.0.4:

  • Scope has two useful undocumented properties:
    1. $parent - can be used as a hack for binding to a primitive property in a parent scope - example
    2. $$phase - can be used to determine if a $digest is already in progress - see this SO answer
  • ng-switch has an undocumented change parameter that accepts an expression (example plnkr)
  • select has an undocumented ng-change parameter that accepts an expression
  • Attributes has an undocumented $observe method (although it is mentioned on the Directives page)
  • $cacheFactory has two undocumented methods (example fiddle)
    1. get()
    2. info()
  • the $location service has two undocumented events
    1. $locationChangeStart(evt, newUrl, oldUrl) (example)
    2. $locationChangeSuccess(evt, newUrl, oldUrl) (see also What's the difference between $locationChangeSuccess and $locationChangeStart?)
  • use ng-value (undocumented) with input type="radio", see Disqus comment in API docs
like image 89
10 revs Avatar answered Sep 27 '22 21:09

10 revs