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

docs(guide/*): fix typos and links #9800

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/guide/bootstrap.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If the {@link ng.directive:ngApp `ng-app`} directive is found then Angular will:
</html>
```

As a best practice, consider consider adding an `ng-strict-di` directive on the same element as
As a best practice, consider adding an `ng-strict-di` directive on the same element as
`ng-app`:


Expand Down
12 changes: 5 additions & 7 deletions docs/content/guide/di.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ and "value" components as dependencies, but they can also be provided with speci
components as dependencies. Note that you cannot inject "providers" into `run` blocks.

- The `config` method accepts a function, which can be injected with "provider" and "constant"
components as dependencies. Note that you cannot inject "service" or "value" components into
components as dependencies. Note that you cannot inject "service" or "value" components into
configuration.

See {@link module#module-loading-dependencies Modules} for more details about `run` and `config`
Expand All @@ -56,8 +56,8 @@ angular.module('myModule', [])

### Module Methods

We can specify functions to run at configuration and run time for a module by calling the `run` and
`config` methods. These functions are injectable with dependencies just like the factory functions
We can specify functions to run at configuration and run time for a module by calling the `config`
and `run` methods. These functions are injectable with dependencies just like the factory functions
above.

```js
Expand Down Expand Up @@ -93,7 +93,7 @@ Moreover, additional dependencies are made available to Controllers:
* {@link scope `$scope`}: Controllers are associated with an element in the DOM and so are
provided with access to the {@link scope scope}. Other components (like services) only have
access to the {@link $rootScope `$rootScope`} service.
* {@link `$route`} resolves: If a controller is instantiated as part of a route, then any values that
* {@link api/ngRoute/provider/$routeProvider#when resolves}: If a controller is instantiated as part of a route, then any values that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngRoute.$routeProvider#when --- I don't know if the link is super clear here, though, you kinda have to dig through it to get what it's talking about. Also, line length

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caitp: Ooops, this was a last minute fix and I didn't think about the line length.
The link is indeed kind of weird, but it's the closest I could get to the resolve property (and it's definitely better than a broken link).

If you think we should create an anchor at resolve and target that specifically, just let me know :)

are resolved as part of the route are made available for injection into the controller.


Expand Down Expand Up @@ -128,8 +128,6 @@ parameters in the function declaration.

### `$inject` Property Annotation

Rather than pass an array to the `controller

To allow the minifiers to rename the function parameters and still be able to inject the right services,
the function needs to be annotated with the `$inject` property. The `$inject` property is an array
of service names to inject.
Expand Down Expand Up @@ -175,7 +173,7 @@ However this method will not work with JavaScript minifiers/obfuscators because
rename parameters.

Tools like [ng-annotate](https://github.com/olov/ng-annotate) let you use implicit dependency
annotations in your app and automatically add annotations array notation prior to minifying.
annotations in your app and automatically add inline array annotations prior to minifying.
If you decide to take this approach, you probably want to use `ng-strict-di`.

Because of these caveats, we recommend avoiding this style of annotation.
Expand Down