aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/tutorial/step_11.ngdoc
diff options
context:
space:
mode:
authorVojta Jina2011-11-11 17:15:22 -0800
committerMisko Hevery2011-11-14 20:31:19 -0800
commitacbd7cdf320f0570fcc1952c8680d4c78bc8fa2c (patch)
tree2483609ada03b9e6ff477596f0402dc24fdd7518 /docs/content/tutorial/step_11.ngdoc
parent035c7510763a9742294d51ba55aea0b6dd08ea58 (diff)
downloadangular.js-acbd7cdf320f0570fcc1952c8680d4c78bc8fa2c.tar.bz2
style(docs): make jslint happy - fix some warnings
Diffstat (limited to 'docs/content/tutorial/step_11.ngdoc')
-rw-r--r--docs/content/tutorial/step_11.ngdoc24
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/content/tutorial/step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc
index e0e2feb5..c6b70065 100644
--- a/docs/content/tutorial/step_11.ngdoc
+++ b/docs/content/tutorial/step_11.ngdoc
@@ -14,7 +14,7 @@ In this step, you will improve the way our app fetches data.
The last improvement we will make to our app is to define a custom service that represents a {@link
http://en.wikipedia.org/wiki/Representational_State_Transfer RESTful} client. Using this client we
can make xhr requests for data in an easier way, without having to deal with the lower-level {@link
-api/angular.module.NG.$xhr $xhr} API, HTTP methods and URLs.
+api/angular.module.ng.$xhr $xhr} API, HTTP methods and URLs.
The most important changes are listed below. You can see the full diff on {@link
https://github.com/angular/angular-phonecat/compare/step-10...step-11
@@ -37,30 +37,30 @@ __`app/index.html`.__
__`app/js/services.js`.__
<pre>
- angular.module.NG('Phone', function($resource) {
+ angular.module.ng('Phone', function($resource) {
return $resource('phones/:phoneId.json', {}, {
query: {method: 'GET', params: {phoneId: 'phones'}, isArray: true}
});
});
</pre>
-We used the {@link api/angular.module.NG} API to register a custom service. We passed in the name of
+We used the {@link api/angular.module.ng} API to register a custom service. We passed in the name of
the service - 'Phone' - and a factory function. The factory function is similar to a controller's
constructor in that both can declare dependencies via function arguments. The Phone service
declared a dependency on the `$resource` service.
-The {@link api/angular.module.NG.$resource `$resource`} service makes it easy to create a {@link
+The {@link api/angular.module.ng.$resource `$resource`} service makes it easy to create a {@link
http://en.wikipedia.org/wiki/Representational_State_Transfer RESTful} client with just a few lines
of code. This client can then be used in our application, instead of the lower-level {@link
-api/angular.module.NG.$xhr $xhr} service.
+api/angular.module.ng.$xhr $xhr} service.
## Controller
We simplified our sub-controllers (`PhoneListCtrl` and `PhoneDetailCtrl`) by factoring out the
-lower-level {@link api/angular.module.NG.$xhr $xhr} service, replacing it with a new service called
-`Phone`. Angular's {@link api/angular.module.NG.$resource `$resource`} service is easier to use than
-{@link api/angular.module.NG.$xhr $xhr} for interacting with data sources exposed as RESTful
+lower-level {@link api/angular.module.ng.$xhr $xhr} service, replacing it with a new service called
+`Phone`. Angular's {@link api/angular.module.ng.$resource `$resource`} service is easier to use than
+{@link api/angular.module.ng.$xhr $xhr} for interacting with data sources exposed as RESTful
resources. It is also easier now to understand what the code in our controllers is doing.
__`app/js/controllers.js`.__
@@ -116,7 +116,7 @@ We have modified our unit tests to verify that our new service is issuing HTTP r
processing them as expected. The tests also check that our controllers are interacting with the
service correctly.
-The {@link api/angular.module.NG.$resource $resource} service augments the response object with
+The {@link api/angular.module.ng.$resource $resource} service augments the response object with
methods for updating and deleting the resource. If we were to use the standard `toEqual` matcher,
our tests would fail because the test values would not match the responses exactly. To solve the
problem, we use a newly-defined `toEqualData` {@link
@@ -141,7 +141,7 @@ describe('PhoneCat controllers', function() {
var scope, $browser, ctrl;
beforeEach(function() {
- scope = angular.module.NG.$rootScope.Scope();
+ scope = angular.module.ng.$rootScope.Scope();
$browser = scope.$service('$browser');
$browser.xhr.expectGET('phones/phones.json')
@@ -167,12 +167,12 @@ describe('PhoneCat controllers', function() {
var scope, $browser, ctrl;
beforeEach(function() {
- scope = angular.module.NG.$rootScope.Scope();
+ scope = angular.module.ng.$rootScope.Scope();
$browser = scope.$service('$browser');
});
beforeEach(function() {
- scope = angular.module.NG.$rootScope.Scope();
+ scope = angular.module.ng.$rootScope.Scope();
$browser = scope.$service('$browser');
});