Skip to content

Commit

Permalink
docs(guide): minor grammar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prognostikos authored and jamessharp committed Jan 18, 2013
1 parent 628221c commit f961f2f
Show file tree
Hide file tree
Showing 32 changed files with 201 additions and 177 deletions.
2 changes: 1 addition & 1 deletion docs/content/cookbook/buzz.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@description

External resources are URLs that provide JSON data, which are then rendered with the help of
templates. angular has a resource factory that can be used to give names to the URLs and then
templates. Angular has a resource factory that can be used to give names to the URLs and then
attach behavior to them. For example you can use the
{@link http://code.google.com/apis/buzz/v1/getting_started.html#background-operations| Google Buzz
API}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/cookbook/deeplinking.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Deep linking allows you to encode the state of the application in the URL so that it can be
bookmarked and the application can be restored from the URL to the same state.

While angular does not force you to deal with bookmarks in any particular way, it has services
While Angular does not force you to deal with bookmarks in any particular way, it has services
which make the common case described here very easy to implement.

# Assumptions
Expand Down
2 changes: 1 addition & 1 deletion docs/content/cookbook/form.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@name Cookbook: Form
@description

A web application's main purpose is to present and gather data. For this reason angular strives
A web application's main purpose is to present and gather data. For this reason Angular strives
to make both of these operations trivial. This example shows off how you can build a simple form to
allow a user to enter data.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/cookbook/helloworld.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

Take a look through the source and note:

* The script tag that {@link guide/bootstrap bootstraps} the angular environment.
* The script tag that {@link guide/bootstrap bootstraps} the Angular environment.
* The text {@link api/ng.directive:input input form control} which is
bound to the greeting name text.
* No need for listener registration and event firing on change events.
* There is no need for listener registration and event firing on change events.
* The implicit presence of the `name` variable which is in the root {@link api/ng.$rootScope.Scope scope}.
* The double curly brace `{{markup}}`, which binds the name variable to the greeting text.
* The concept of {@link guide/dev_guide.templates.databinding data binding}, which reflects any
Expand Down
6 changes: 3 additions & 3 deletions docs/content/cookbook/index.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@name Cookbook
@description

Welcome to the angular cookbook. Here we will show you typical uses of angular by example.
Welcome to the Angular cookbook. Here we will show you typical uses of Angular by example.


# Hello World
Expand Down Expand Up @@ -45,7 +45,7 @@ allowing you to send links to specific screens in your app.
# Services

{@link api/ng Services}: Services are long lived objects in your applications that are
available across controllers. A collection of useful services are pre-bundled with angular but you
available across controllers. A collection of useful services are pre-bundled with Angular but you
will likely add your own. Services are initialized using dependency injection, which resolves the
order of initialization. This safeguards you from the perils of global state (a common way to
implement long lived objects).
Expand All @@ -55,4 +55,4 @@ implement long lived objects).

{@link buzz Resources}: Web applications must be able to communicate with the external
services to get and update data. Resources are the abstractions of external URLs which are
specially tailored to angular data binding.
specially tailored to Angular data binding.
4 changes: 2 additions & 2 deletions docs/content/cookbook/mvc.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@name Cookbook: MVC
@description

MVC allows for a clean an testable separation between the behavior (controller) and the view
MVC allows for a clean and testable separation between the behavior (controller) and the view
(HTML template). A Controller is just a JavaScript class which is grafted onto the scope of the
view. This makes it very easy for the controller and the view to share the model.

Expand Down Expand Up @@ -115,7 +115,7 @@ view.
# Things to notice

* The controller is defined in JavaScript and has no reference to the rendering logic.
* The controller is instantiated by <angular/> and injected into the view.
* The controller is instantiated by Angular and injected into the view.
* The controller can be instantiated in isolation (without a view) and the code will still execute.
This makes it very testable.
* The HTML view is a projection of the model. In the above example, the model is stored in the
Expand Down
18 changes: 9 additions & 9 deletions docs/content/guide/compiler.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ browser new HTML syntax. The compiler allows you to attach behavior to any HTML
and even create new HTML element or attributes with custom behavior. Angular calls these behavior
extensions {@link api/ng.$compileProvider#directive directives}.

HTML has a lot of constructs for formatting the HTML for static documents in declarative fashion.
HTML has a lot of constructs for formatting the HTML for static documents in a declarative fashion.
For example if something needs to be centered, there is no need to provide instructions to the
browser how the window size needs to be divided in half so that center is found, and that this
center needs to be aligned with the text's center. Simply add `align="center"` attribute to any
Expand Down Expand Up @@ -37,7 +37,7 @@ process happens into two phases.

2. **Link:** combine the directives with a scope and produce a live view. Any changes in the
scope model are reflected in the view, and any user interactions with the view are reflected
in the scope model. Making the scope model a single source of truth.
in the scope model. This makes the scope model the single source of truth.

Some directives such {@link api/ng.directive:ngRepeat
`ng-repeat`} clone DOM elements once for each item in collection. Having a compile and link phase
Expand All @@ -47,9 +47,9 @@ once for each clone instance.

# Directive

Directive is a behavior which should be triggered when specific HTML constructs are encountered in
compilation process. The directives can be placed in element names, attributes, class names, as
well as comments. Here are some equivalent examples of invoking {@link
A directive is a behavior which should be triggered when specific HTML constructs are encountered in
the compilation process. The directives can be placed in element names, attributes, class names, as
well as comments. Here are some equivalent examples of invoking the {@link
api/ng.directive:ngBind `ng-bind`} directive.

<pre>
Expand All @@ -59,7 +59,7 @@ api/ng.directive:ngBind `ng-bind`} directive.
<!-- directive: ng-bind exp -->
</pre>

Directive is just a function which executes when the compiler encounters it in the DOM. See {@link
A directive is just a function which executes when the compiler encounters it in the DOM. See {@link
api/ng.$compileProvider#directive directive API} for in-depth documentation on how
to write directives.

Expand Down Expand Up @@ -107,9 +107,9 @@ Here is a directive which makes any element draggable. Notice the `draggable` at
</example>


The presence of `draggable` attribute on any element gives the element new behavior. The beauty of
The presence of the `draggable` attribute on any element gives the element new behavior. The beauty of
this approach is that we have taught the browser a new trick. We have extended the vocabulary of
what the browser understands in a way, which is natural to anyone who is familiar with HTML
what the browser understands in a way which is natural to anyone who is familiar with HTML
principles.


Expand All @@ -122,7 +122,7 @@ an element.
<img src="img/One_Way_Data_Binding.png">

This means that any changes to the data need to be re-merged with the template and then
`innerHTML`ed into the DOM. Some of the issues are: reading user input and merging it with data,
`innerHTML`ed into the DOM. Some of the issues with this approach are: reading user input and merging it with data,
clobbering user input by overwriting it, managing the whole update process, and lack of behavior
expressiveness.

Expand Down
56 changes: 28 additions & 28 deletions docs/content/guide/concepts.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ This is how we get the ball rolling (refer to the diagram and example below):

<img class="pull-right" style="padding-left: 3em;" src="img/guide/concepts-startup.png">

1. Browser loads the HTML and parses it into a DOM
2. Browser loads `angular.js` script
1. The browser loads the HTML and parses it into a DOM
2. The browser loads `angular.js` script
3. Angular waits for `DOMContentLoaded` event
4. Angular looks for {@link api/ng.directive:ngApp ng-app}
{@link guide/directive directive}, which designates application boundary
5. {@link guide/module Module} specified in {@link
{@link guide/directive directive}, which designates the application boundary
5. The {@link guide/module Module} specified in {@link
api/ng.directive:ngApp ng-app} (if any) is used to configure
the {@link api/AUTO.$injector $injector}
6. {@link api/AUTO.$injector $injector} is used to create the {@link
6. The {@link api/AUTO.$injector $injector} is used to create the {@link
api/ng.$compile $compile} service as well as {@link
api/ng.$rootScope $rootScope}
7. {@link api/ng.$compile $compile} service is used to compile the DOM and link
7. The {@link api/ng.$compile $compile} service is used to compile the DOM and link
it with {@link api/ng.$rootScope $rootScope}
8. {@link api/ng.directive:ngInit ng-init} {@link
8. The {@link api/ng.directive:ngInit ng-init} {@link
guide/directive directive} assigns `World` to the `name` property on the {@link guide/scope
scope}
9. The `{{name}}` {@link api/ng.$interpolate interpolates} the expression to
Expand All @@ -59,21 +59,21 @@ This is how we get the ball rolling (refer to the diagram and example below):

<img class="pull-right" style="padding-left: 3em; padding-bottom: 1em;" src="img/guide/concepts-runtime.png">

The diagram and the example below describe how Angular interacts with browser's event loop.
The diagram and the example below describe how Angular interacts with the browser's event loop.

1. Browsers event-loop waits for an event to arrive. Event is a user interactions, timer event,
1. The browser's event-loop waits for an event to arrive. An event is a user interactions, timer event,
or network event (response from a server).
2. The events callback gets executed. This enters the JavaScript context. The callback can
2. The event's callback gets executed. This enters the JavaScript context. The callback can
modify the DOM structure.
3. Once the callback finishes execution, the browser leaves the JavaScript context and
3. Once the callback executes, the browser leaves the JavaScript context and
re-renders the view based on DOM changes.

Angular modifies the normal JavaScript flow by providing it's own event processing loop. This
Angular modifies the normal JavaScript flow by providing its own event processing loop. This
splits the JavaScript into classical and Angular execution context. Only operations which are
applied in Angular execution context will benefit from angular data-binding, exception handling,
property watching, etc... Use $apply() to enter Angular execution context from JavaScript. Keep in
mind that in most places (controllers, services) the $apply has already been called for you by the
directive which is handling the event. The need to call $apply is reserved only when
applied in Angular execution context will benefit from Angular data-binding, exception handling,
property watching, etc... You can also use $apply() to enter Angular execution context from JavaScript. Keep in
mind that in most places (controllers, services) $apply has already been called for you by the
directive which is handling the event. An explicit call to $apply is needed only when
implementing custom event callbacks, or when working with a third-party library callbacks.

1. Enter Angular execution context by calling {@link guide/scope scope}`.`{@link
Expand All @@ -89,14 +89,14 @@ implementing custom event callbacks, or when working with a third-party library
$evalAsync} queue is empty and the {@link api/ng.$rootScope.Scope#$watch
$watch} list does not detect any changes.
4. The {@link api/ng.$rootScope.Scope#$evalAsync $evalAsync} queue is used to
schedule work which needs to occur outside of current stack frame, but before the browser
schedule work which needs to occur outside of current stack frame, but before the browser's
view render. This is usually done with `setTimeout(0)`, but the `setTimeout(0)` approach
suffers from slowness and may cause view flickering since the browser renders the view after
each event.
5. The {@link api/ng.$rootScope.Scope#$watch $watch} list is a set of expressions
which may have changed since last iteration. If a change is detected then the `$watch`
function is called which typically updates the DOM with the new value.
6. Once Angular {@link api/ng.$rootScope.Scope#$digest $digest} loop finishes
6. Once the Angular {@link api/ng.$rootScope.Scope#$digest $digest} loop finishes
the execution leaves the Angular and JavaScript context. This is followed by the browser
re-rendering the DOM to reflect any changes.

Expand Down Expand Up @@ -188,7 +188,7 @@ a diagram depicting the scope boundaries.

<img class="pull-right" style="padding-left: 3em; padding-bottom: 1em;" src="img/guide/concepts-controller.png">

Controller is the code behind the view. Its job is to construct the model and publish it to the
A controller is the code behind the view. Its job is to construct the model and publish it to the
view along with callback methods. The view is a projection of the scope onto the template (the
HTML). The scope is the glue which marshals the model to the view and forwards the events to the
controller.
Expand Down Expand Up @@ -233,7 +233,7 @@ The separation of the controller and the view is important because:
<img class="pull-right" style="padding-left: 3em; padding-bottom: 1em;" src="img/guide/concepts-model.png">

The model is the data which is used merged with the template to produce the view. To be able to
render the model into the view, the model has to be referenceable from the scope. Unlike many
render the model into the view, the model has to be able to be referenced from the scope. Unlike many
other frameworks Angular makes no restrictions or requirements an the model. There are no classes
to inherit from or special accessor methods for accessing or changing the model. The model can be
primitive, object hash, or a full object Type. In short the model is a plain JavaScript object.
Expand All @@ -250,7 +250,7 @@ primitive, object hash, or a full object Type. In short the model is a plain Jav

The view is what the users sees. The view begins its life as a template, it is merged with the
model and finally rendered into the browser DOM. Angular takes a very different approach to
rendering the view, to most other templating systems.
rendering the view, compared to most other templating systems.

* **Others** - Most templating systems begin as an HTML string with special templating markup.
Often the template markup breaks the HTML syntax which means that the template can not be
Expand All @@ -261,9 +261,9 @@ rendering the view, to most other templating systems.
is the granularity of the DOM updates. The key here is that the templating system manipulates
strings.
* **Angular** - Angular is different, since its templating system works on DOM objects not on
strings. The template is still written in HTML string, but it is HTML (not HTML with
template sprinkled in.) The browser parses the HTML into DOM, and the DOM becomes the input to
the template engine know as the {@link api/ng.$compile compiler}. The compiler
strings. The template is still written in an HTML string, but it is HTML (not HTML with
template sprinkled in.) The browser parses the HTML into the DOM, and the DOM becomes the input to
the template engine known as the {@link api/ng.$compile compiler}. The compiler
looks for {@link guide/directive directives} which in turn set up {@link
api/ng.$rootScope.Scope#$watch watches} on the model. The result is a
continuously updating view which does not need template model re-merging. Your model becomes
Expand Down Expand Up @@ -291,7 +291,7 @@ rendering the view, to most other templating systems.
<a name="directives"></a>
# Directives

A directive is a behavior or DOM transformation which is triggered by a presence of an attribute,
A directive is a behavior or DOM transformation which is triggered by the presence of a custom attribute,
element name, or a class name. A directive allows you to extend the HTML vocabulary in a
declarative fashion. Following is an example which enables data-binding for the `contenteditable`
in HTML.
Expand Down Expand Up @@ -337,7 +337,7 @@ in HTML.
<a name="filters"></a>
# Filters

{@link api/ng.$filter Filters} perform data transformation roles. Typically
{@link api/ng.$filter Filters} perform data transformation. Typically
they are used in conjunction with the locale to format the data in locale specific output.
They follow the spirit of UNIX filters and use similar syntax `|` (pipe).

Expand All @@ -358,7 +358,7 @@ They follow the spirit of UNIX filters and use similar syntax `|` (pipe).

<img class="pull-right" style="padding-left: 3em; padding-bottom: 1em;" src="img/guide/concepts-module-injector.png">

An {@link api/AUTO.$injector injector} is a service locator. There is a single
The {@link api/AUTO.$injector injector} is a service locator. There is a single
{@link api/AUTO.$injector injector} per Angular {@link
api/ng.directive:ngApp application}. The {@link
api/AUTO.$injector injector} provides a way to look up an object instance by its
Expand Down Expand Up @@ -438,7 +438,7 @@ dependencies, look for dependencies, or even get a reference to the injector.
</file>
<file name="script.js">
angular.module('timeExampleModule', []).
// Declare new object call time,
// Declare new object called time,
// which will be available for injection
factory('time', function($timeout) {
var time = {};
Expand Down
4 changes: 2 additions & 2 deletions docs/content/guide/dev_guide.e2e-testing.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ that will help you verify the health of your Angular application.

# Overview
You will write scenario tests in JavaScript, which describe how your application should behave,
given a certain interaction in a specific state. A scenario is comprised of one or more it blocks
given a certain interaction in a specific state. A scenario is comprised of one or more `it` blocks
(you can think of these as the requirements of your application), which in turn are made of
**commands** and **expectations**. Commands tell the Runner to do something with the application
(such as navigate to a page or click on a button), and expectations tell the Runner to assert
Expand Down Expand Up @@ -175,4 +175,4 @@ Executes the `method` passing in `key` and `value` on the element matching the g
JavaScript is a dynamically typed language which comes with great power of expression, but it also
come with almost no-help from the compiler. For this reason we feel very strongly that any code
written in JavaScript needs to come with a strong set of tests. We have built many features into
angular which makes testing your angular applications easy. So there is no excuse for not do it.
angular which makes testing your angular applications easy. So there is no excuse for not testing.
4 changes: 2 additions & 2 deletions docs/content/guide/dev_guide.mvc.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
@description

While Model-View-Controller (MVC) has acquired different shades of meaning over the years since it
first appeared, angular incorporates the basic principles behind the original {@link
first appeared, Angular incorporates the basic principles behind the original {@link
http://en.wikipedia.org/wiki/Model–view–controller MVC} software design pattern into its way of
building client-side web applications.

The MVC pattern greatly summarized:
The MVC pattern summarized:

* Separate applications into distinct presentation, data, and logic components
* Encourage loose coupling between these components
Expand Down
Loading

0 comments on commit f961f2f

Please sign in to comment.