|
2 | 2 | @name API Reference
|
3 | 3 | @description
|
4 | 4 |
|
5 |
| -Use the API Reference documentation when you need more information about a specific feature. Check out |
6 |
| -{@link guide/ Developer Guide} for AngularJS concepts. If you are new to AngularJS we recommend the |
7 |
| -{@link tutorial/ Tutorial}. |
| 5 | +# AngularJS API Docs |
| 6 | +Welcome to the AngularJS API docs page. The pages here contain the AngularJS reference materials for version <strong ng-bind="version"></strong>. |
| 7 | + |
| 8 | +The docs are organized into **modules** which contain various components of an AngularJS application. |
| 9 | +These components are directives, services, filters, providers, types, global APIs and testing mocks. |
| 10 | + |
| 11 | +## {@link ng ng (core module)} |
| 12 | +This module is provided by default and contains the core components of AngularJS. |
| 13 | + |
| 14 | +<table class="definition-table spaced"> |
| 15 | + <tr> |
| 16 | + <td>{@link ng#directive Directives}</td> |
| 17 | + <td> |
| 18 | + <p> |
| 19 | + This is the core collection of directives you would use in your template code to build an AngularJS application. |
| 20 | + </p> |
| 21 | + |
| 22 | + <p> |
| 23 | + Some examples include: |
| 24 | + {@link ng.ngClick ngClick}, |
| 25 | + {@link ng.ngInclude ngInclude}, |
| 26 | + {@link ng.ngInclude ngRepeat}, |
| 27 | + etc… <br /> |
| 28 | + </p> |
| 29 | + </td> |
| 30 | + </tr> |
| 31 | + <tr> |
| 32 | + <td> |
| 33 | + {@link ng#service Services / Factories} |
| 34 | + </td> |
| 35 | + <td> |
| 36 | + <p> |
| 37 | + This is the core collection of services which are used within the DI of your application. |
| 38 | + </p> |
| 39 | + <p> |
| 40 | + Some examples include: |
| 41 | + {@link ng.$compile $compile}, |
| 42 | + {@link ng.$http $http}, |
| 43 | + {@link ng.$routeParams $routeParams}, |
| 44 | + {@link ng.$location $location}, |
| 45 | + etc… |
| 46 | + <p> |
| 47 | + </td> |
| 48 | + </tr> |
| 49 | + <tr> |
| 50 | + <td> |
| 51 | + {@link ng#filter Filters} |
| 52 | + </td> |
| 53 | + <td> |
| 54 | + <p> |
| 55 | + The core filters available in the ng module are used to transform template data before it is renders within directives and expressions. |
| 56 | + </p> |
| 57 | + <p> |
| 58 | + Some examples include: |
| 59 | + {@link ng.filter:filter filter}, |
| 60 | + {@link ng.filter:date date}, |
| 61 | + {@link ng.filter:currency currency}, |
| 62 | + {@link ng.filter:lowercase lowercase}, |
| 63 | + {@link ng.filter:uppercase uppercase}, |
| 64 | + etc... |
| 65 | + </p> |
| 66 | + </td> |
| 67 | + </tr> |
| 68 | + <tr> |
| 69 | + <td> |
| 70 | + {@link ng#function Global APIs} |
| 71 | + </td> |
| 72 | + <td> |
| 73 | + <p> |
| 74 | + The core global API functions are attached to the angular object. These core functions are useful for low level JavaScript operations within your application. |
| 75 | + </p> |
| 76 | + <p> |
| 77 | + Some examples include: |
| 78 | + {@link angular.copy angular.copy()}, |
| 79 | + {@link angular.equals angular.equals()}, |
| 80 | + {@link angular.element angular.element()}, |
| 81 | + etc... |
| 82 | + </p> |
| 83 | + </td> |
| 84 | + </tr> |
| 85 | +</table> |
| 86 | + |
| 87 | + |
| 88 | +## {@link ngRoute ngRoute} |
| 89 | + |
| 90 | +Use ngRoute to enable URL routing to your application. The ngRoute module supports URL management via both hashbang and HTML5 pushState. |
| 91 | + |
| 92 | +<div class="alert alert-info">Include the **angular-route.js** file and set **ngRoute** as a dependency for this to work in your application.</div> |
| 93 | + |
| 94 | +<table class="definition-table spaced"> |
| 95 | + <tr> |
| 96 | + <td> |
| 97 | + {@link ngRoute#service Services / Factories} |
| 98 | + </td> |
| 99 | + <td> |
| 100 | + The following services are used for route management: |
| 101 | + <ul> |
| 102 | + <li>{@link ngRoute.$routeParams $routeParams} is used to access the querystring values present in the URL.</li> |
| 103 | + <li>{@link ngRoute.$route $route} is used to access the details of the route that is currently being accessed.</li> |
| 104 | + <li>{@link ngRoute.$routeProvider $routeProvider} is used to register routes for the application.</li> |
| 105 | + </ul> |
| 106 | + </td> |
| 107 | + </tr> |
| 108 | + <tr> |
| 109 | + <td> |
| 110 | + {@link ngRoute#directive Directives} |
| 111 | + </td> |
| 112 | + <td> |
| 113 | + The {@link ngRoute.directive:ngView ngView} directive will display the template of the current route within the page. |
| 114 | + </td> |
| 115 | + </tr> |
| 116 | +</table> |
| 117 | + |
| 118 | + |
| 119 | +## {@link ngAnimate ngAnimate} |
| 120 | + |
| 121 | +Use ngAnimate to enable animation features into your application. Various core ng directives will provide |
| 122 | +animation hooks into your application when ngAnimate is included. Animations are defined by using CSS transitions/animations |
| 123 | +or JavaScript callbacks. |
| 124 | + |
| 125 | +<div class="alert alert-info">Include the **angular-animate.js** file and set **ngAnimate** as a dependency for this to work in your application.</div> |
| 126 | + |
| 127 | +<table class="definition-table spaced"> |
| 128 | + <tr> |
| 129 | + <td> |
| 130 | + {@link ngAnimate#service Services / Factories} |
| 131 | + </td> |
| 132 | + <td> |
| 133 | + Use {@link ngAnimate.$animate $animate} to trigger animation operations within your directive code. |
| 134 | + </td> |
| 135 | + </tr> |
| 136 | + <tr> |
| 137 | + <td> |
| 138 | + {@link ngAnimate CSS-based animations} |
| 139 | + </td> |
| 140 | + <td> |
| 141 | + 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. |
| 142 | + </td> |
| 143 | + </tr> |
| 144 | + <tr> |
| 145 | + <td> |
| 146 | + {@link ngAnimate JS-based animations} |
| 147 | + </td> |
| 148 | + <td> |
| 149 | + Use {@link angular.Module#animation module.animation()} to register a JavaScript animation. Once registered the animation can be triggered by referencing the CSS class within the HTML template code. |
| 150 | + </td> |
| 151 | + </tr> |
| 152 | +</table> |
| 153 | + |
| 154 | + |
| 155 | +## {@link ngResource ngResource} |
| 156 | + |
| 157 | +Use the ngResource module when querying and posting data to a REST API. |
| 158 | + |
| 159 | +<div class="alert alert-info">Include the **angular-resource.js** file and set **ngResource** as a dependency for this to work in your application.</div> |
| 160 | + |
| 161 | +<table class="definition-table spaced"> |
| 162 | + <tr> |
| 163 | + <td> |
| 164 | + {@link ngResource#service Services / Factories} |
| 165 | + </td> |
| 166 | + <td> |
| 167 | + The {@link ngResource.$resource $resource} service is used to define RESTful objects which communicate with a REST API. |
| 168 | + </td> |
| 169 | + </tr> |
| 170 | +</table> |
| 171 | + |
| 172 | +## {@link ngCookies ngCookies} |
| 173 | + |
| 174 | +Use the ngCookies module to handle cookie management within your application. |
| 175 | + |
| 176 | +<div class="alert alert-info">Include the **angular-cookies.js** file and set **ngCookies** as a dependency for this to work in your application.</div> |
| 177 | + |
| 178 | +<table class="definition-table spaced"> |
| 179 | + <tr> |
| 180 | + <td> |
| 181 | + {@link ngCookies#service Services / Factories} |
| 182 | + </td> |
| 183 | + <td> |
| 184 | + The following services are used for cookie management: |
| 185 | + <ul> |
| 186 | + <li>The {@link ngCookies.$cookies $cookie} service is a convenient wrapper to store simple data within browser cookies.</li> |
| 187 | + <li>{@link ngCookies.$cookieStore $cookieStore} is used to store more complex data using serialization.</li> |
| 188 | + </ul> |
| 189 | + </td> |
| 190 | + </tr> |
| 191 | +</table> |
| 192 | + |
| 193 | +## {@link ngTouch ngTouch} |
| 194 | + |
| 195 | +Use ngTouch when developing for mobile browsers/devices. |
| 196 | + |
| 197 | +<div class="alert alert-info">Include the **angular-touch.js** file and set **ngTouch** as a dependency for this to work in your application.</div> |
| 198 | + |
| 199 | +<table class="definition-table spaced"> |
| 200 | + <tr> |
| 201 | + <td> |
| 202 | + {@link ngTouch#service Services / Factories} |
| 203 | + </td> |
| 204 | + <td> |
| 205 | + The {@link ngTouch.$swipe $swipe} service is used to register and manage mobile DOM events. |
| 206 | + </td> |
| 207 | + </tr> |
| 208 | + <tr> |
| 209 | + <td> |
| 210 | + {@link ngTouch#directive Directives} |
| 211 | + </td> |
| 212 | + <td> |
| 213 | + Various directives are available in ngTouch to emulate mobile DOM events. |
| 214 | + </td> |
| 215 | + </tr> |
| 216 | +</table> |
| 217 | + |
| 218 | +## {@link ngSanitize ngSanitize} |
| 219 | + |
| 220 | +Use ngSanitize to securely parse and manipulate HTML data in your application. |
| 221 | + |
| 222 | +<div class="alert alert-info">Include the **angular-sanitize.js** file and set **ngSanitize** as a dependency for this to work in your application.</div> |
| 223 | + |
| 224 | +<table class="definition-table spaced"> |
| 225 | + <tr> |
| 226 | + <td> |
| 227 | + {@link ngSanitize#service Services / Factories} |
| 228 | + </td> |
| 229 | + <td> |
| 230 | + The {@link ngSanitize.$sanitize $sanitize} service is used to clean up dangerous HTML code in a quick and convenient way. |
| 231 | + </td> |
| 232 | + </tr> |
| 233 | + <tr> |
| 234 | + <td> |
| 235 | + {@link ngTouch#filter Filters} |
| 236 | + </td> |
| 237 | + <td> |
| 238 | + The {@link ngSanitize.filter:linky linky filter} is used to turn URLs into HTML links within the provided string. |
| 239 | + </td> |
| 240 | + </tr> |
| 241 | +</table> |
| 242 | + |
| 243 | +## {@link ngMock ngMock} |
| 244 | + |
| 245 | +Use ngMock to inject and mock modules, factories, services and providers within your unit tests |
| 246 | + |
| 247 | +<div class="alert alert-info">Include the **angular-mocks.js** file into your test runner for this to work.</div> |
| 248 | + |
| 249 | +<table class="definition-table spaced"> |
| 250 | + <tr> |
| 251 | + <td> |
| 252 | + {@link ngMock#service Services / Factories} |
| 253 | + </td> |
| 254 | + <td> |
| 255 | + <p> |
| 256 | + ngMock will extend the behavior of various core services to become testing aware and manageable in a synchronous manner. |
| 257 | + <p> |
| 258 | + |
| 259 | + <p> |
| 260 | + Some examples include: |
| 261 | + {@link ngMock.$timeout $timeout}, |
| 262 | + {@link ngMock.$interval $interval}, |
| 263 | + {@link ngMock.$log $log}, |
| 264 | + {@link ngMock.$httpBackend $httpBackend}, |
| 265 | + etc... |
| 266 | + <p> |
| 267 | + </td> |
| 268 | + </tr> |
| 269 | + <tr> |
| 270 | + <td> |
| 271 | + {@link ngMock#function Global APIs} |
| 272 | + </td> |
| 273 | + <td> |
| 274 | + <p> |
| 275 | + Various helper functions are available to inject and mock modules within unit test code. |
| 276 | + </p> |
| 277 | + |
| 278 | + <p> |
| 279 | + Some examples |
| 280 | + {@link angular.mock.inject inject()}, |
| 281 | + {@link angular.mock.module module()}, |
| 282 | + {@link angular.mock.dump dump()}, |
| 283 | + etc... |
| 284 | + <p> |
| 285 | + </td> |
| 286 | + </tr> |
| 287 | +</table> |
0 commit comments