Copy edit docs

This commit is contained in:
David Niergarth 2014-05-26 23:51:16 -05:00
parent ea0b661b79
commit 9ea782f759
19 changed files with 100 additions and 98 deletions

View file

@ -53,7 +53,7 @@ m.request({method: "GET", url: "/user"}).then(users).then(doSomething)
While both basic assignment syntax and thennable syntax can be used to the same effect, typically it's recommended that you use the assignment syntax whenever possible, as it's easier to read.
The thennable mechanism is intended to be used in 3 ways:
The thennable mechanism is intended to be used in three ways:
- in the model layer: to process web service data in transformative ways (e.g. filtering a list based on a parameter that the web service doesn't support)
- in the controller layer: to bind redirection code upon a condition
@ -136,7 +136,7 @@ As you saw, you can chain operations that act on the response data. Typically th
- in the controller, to redirect after a model service resolves.
- in the controller, to bind error messages
In the example below, we take advantage of queuing to debug the ajax response data prior to doing further processing on the user list
In the example below, we take advantage of queuing to debug the AJAX response data prior to doing further processing on the user list
```javascript
var users = m.request({method: "GET", url: "/user"})
@ -155,7 +155,7 @@ var users = m.request({method: "GET", url: "/user"})
### Casting the Response Data to a Class
It's possible to auto-cast a JSON response to a class. This is useful when we want to control access to certain properties in an object, as opposed to exposing all the fields in POJOs (plain old javascript objects) for arbitrary processing.
It's possible to auto-cast a JSON response to a class. This is useful when we want to control access to certain properties in an object, as opposed to exposing all the fields in POJOs (plain old Javascript objects) for arbitrary processing.
In the example below, `User.list` returns a list of `User` instances.