AngularJS API Docs
Welcome to the AngularJS API docs page.
These pages contain the AngularJS reference materials for version 1.8.4-local+sha.47bf11ee9 snapshot.
The documentation is organized into modules which contain various components of an AngularJS application. These components are directives, services, filters, providers, templates, global APIs, and testing mocks.
There is also a guide with articles on various topics, and a list of external resources.
$
and $$
:
To prevent accidental name collisions with your code,
AngularJS prefixes names of public objects with $
and names of private objects with $$
.
Please do not use the $
or $$
prefix in your code.
AngularJS Modules
ng (core module)
This module is provided by default and contains the core components of AngularJS.
Directives |
This is the core collection of directives you would use in your template code to build an AngularJS application. |
Services / Factories |
This is the core collection of services which are used within the DI of your application. Some examples include: $compile, $http, $location, etc…
|
Filters |
The core filters available in the ng module are used to transform template data before it is rendered within directives and expressions. Some examples include: filter, date, currency, lowercase, uppercase, etc... |
Global APIs |
The core global API functions are attached to the Some examples include: angular.copy(), angular.equals(), angular.element(), etc... |
ngRoute
Use ngRoute to enable URL routing to your application. The ngRoute module supports URL management via both hashbang and HTML5 pushState.
Services / Factories |
The following services are used for route management:
|
Directives | The ngView directive will display the template of the current route within the page. |
ngAnimate
Use ngAnimate to enable animation features within your application. Various core AngularJS directives will provide animation hooks into your application when ngAnimate is included. Animations are defined by using CSS transitions/animations or JavaScript callbacks.
Services / Factories | Use $animate to trigger animation operations within your directive code. |
CSS-based animations | Follow ngAnimate’s CSS naming structure to reference CSS transitions / keyframe animations in AngularJS. Once defined, the animation can be triggered by referencing the CSS class within the HTML template code. |
JS-based animations | Use module.animation() to register a JavaScript animation. Once registered, the animation can be triggered by referencing the CSS class within the HTML template code. |
ngAria
Use ngAria to inject common accessibility attributes into directives and improve the experience for users with disabilities.
Services |
The $aria service contains helper methods for applying ARIA attributes to HTML.
$ariaProvider is used for configuring ARIA attributes. |
ngResource
Use the ngResource module when querying and posting data to a REST API.
Services / Factories | The $resource service is used to define RESTful objects which communicate with a REST API. |
ngCookies
Use the ngCookies module to handle cookie management within your application.
Services / Factories | The $cookies service is a convenient wrapper to store simple data within browser cookies. |
ngTouch
Use ngTouch when developing for mobile browsers/devices.
Services / Factories | The $swipe service is used to register and manage mobile DOM events. |
Directives | Various directives are available in ngTouch to emulate mobile DOM events. |
ngSanitize
Use ngSanitize to securely parse and manipulate HTML data in your application.
Services / Factories | The $sanitize service is used to clean up dangerous HTML code in a quick and convenient way. |
Filters | The linky filter is used to turn URLs into HTML links within the provided string. |
ngMock
Use ngMock to inject and mock modules, factories, services and providers within your unit tests.
Services / Factories |
ngMock will extend the behavior of various core services to become testing aware and manageable in a synchronous manner.
Some examples include: $timeout, $interval, $log, $httpBackend, etc...
|
Global APIs |
Various helper functions are available to inject and mock modules within unit test code. Some examples inject(), module(), dump(), etc...
|