Skip to content

Commit 27f8c86

Browse files
gkalpakpetebacondarwin
authored andcommitted
docs(guide/concepts): improve wording
1 parent 7dc73b7 commit 27f8c86

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/content/guide/concepts.ngdoc

+8-5
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ different currencies and also pay the invoice.
151151
What changed?
152152

153153
First, there is a new JavaScript file that contains a <a name="controller">{@link controller controller}</a>.
154-
More exactly, the file contains a constructor function that creates the actual controller instance.
155-
The purpose of controllers is to expose variables and functionality to expressions and directives.
154+
More accurately, the file specifies a constructor function that will be used to create the actual
155+
controller instance. The purpose of controllers is to expose variables and functionality to
156+
expressions and directives.
156157

157158
Besides the new file that contains the controller code we also added an
158159
{@link ng.directive:ngController `ng-controller`} directive to the HTML.
@@ -251,6 +252,7 @@ Let's refactor our example and move the currency conversion into a service in an
251252
<img class="pull-right" style="padding-left: 3em; padding-bottom: 1em;" src="img/guide/concepts-module-service.png">
252253

253254
What changed?
255+
254256
We moved the `convertCurrency` function and the definition of the existing currencies
255257
into the new file `finance2.js`. But how does the controller
256258
get a hold of the now separated function?
@@ -274,10 +276,11 @@ The code snippet `angular.module('invoice2', ['finance2'])` specifies that the
274276
`finance2` module. By this, Angular uses the `InvoiceController` as well as the `currencyConverter` service.
275277

276278
Now that Angular knows of all the parts of the application, it needs to create them.
277-
In the previous section we saw that controllers are created using a factory function.
278-
For services there are multiple ways to define their factory
279+
In the previous section we saw that controllers are created using a constructor function.
280+
For services, there are multiple ways to specify how they are created
279281
(see the {@link services service guide}).
280-
In the example above, we are using an anonymous function as the factory function for `currencyConverter` service.
282+
In the example above, we are using an anonymous function as the factory function for the
283+
`currencyConverter` service.
281284
This function should return the `currencyConverter` service instance.
282285

283286
Back to the initial question: How does the `InvoiceController` get a reference to the `currencyConverter` function?

0 commit comments

Comments
 (0)