Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4c613a2

Browse files
meldaravaniellgalfaso
authored andcommitted
docs(guide/Controllers): grammar and header fixes
fixed a comma and made the headers more logical.
1 parent e6688ec commit 4c613a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/content/guide/controller.ngdoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ Do not use controllers to:
3030
services} instead.
3131
- Manage the life-cycle of other components (for example, to create service instances).
3232

33-
# Setting up the initial state of a `$scope` object
33+
## Setting up the initial state of a `$scope` object
3434

3535
Typically, when you create an application you need to set up the initial state for the Angular
3636
`$scope`. You set up the initial state of a scope by attaching properties to the `$scope` object.
3737
The properties contain the **view model** (the model that will be presented by the view). All the
38-
`$scope` properties will be available to the template at the point in the DOM where the Controller
38+
`$scope` properties will be available to the {@link templates template} at the point in the DOM where the Controller
3939
is registered.
4040

4141
The following example demonstrates creating a `GreetingController`, which attaches a `greeting`
@@ -69,7 +69,7 @@ now be data-bound to the template:
6969
```
7070

7171

72-
# Adding Behavior to a Scope Object
72+
## Adding Behavior to a Scope Object
7373

7474
In order to react to events or execute computation in the view we must provide behavior to the
7575
scope. We add behavior to the scope by attaching methods to the `$scope` object. These methods are
@@ -99,7 +99,7 @@ objects (or primitives) assigned to the scope become model properties. Any metho
9999
the scope are available in the template/view, and can be invoked via angular expressions
100100
and `ng` event handler directives (e.g. {@link ng.directive:ngClick ngClick}).
101101

102-
# Using Controllers Correctly
102+
## Using Controllers Correctly
103103

104104
In general, a Controller shouldn't try to do too much. It should contain only the business logic
105105
needed for a single view.
@@ -125,7 +125,7 @@ following components:
125125
- A model consisting of a string named `spice`
126126
- A Controller with two functions that set the value of `spice`
127127

128-
The message in our template contains a binding to the `spice` model, which by default is set to the
128+
The message in our template contains a binding to the `spice` model which, by default, is set to the
129129
string "very". Depending on which button is clicked, the `spice` model is set to `chili` or
130130
`jalapeño`, and the message is automatically updated by data-binding.
131131

@@ -259,7 +259,7 @@ Inheritance works with methods in the same way as it does with properties. So in
259259
examples, all of the properties could be replaced with methods that return string values.
260260

261261

262-
## Testing Controllers
262+
# Testing Controllers
263263

264264
Although there are many ways to test a Controller, one of the best conventions, shown below,
265265
involves injecting the {@link ng.$rootScope $rootScope} and {@link ng.$controller $controller}:

0 commit comments

Comments
 (0)