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

Commit d1ccf17

Browse files
committed
docs(guide/*): improve explanation of strictDi
Closes #9786
1 parent c3fcbbd commit d1ccf17

File tree

3 files changed

+245
-263
lines changed

3 files changed

+245
-263
lines changed

docs/content/guide/bootstrap.ngdoc

+17
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,23 @@ If the {@link ng.directive:ngApp `ng-app`} directive is found then Angular will:
7373
</html>
7474
```
7575

76+
As a best practice, consider consider adding an `ng-strict-di` directive on the same element as
77+
`ng-app`:
78+
79+
80+
```html
81+
<!doctype html>
82+
<html ng-app="optionalModuleName" ng-strict-di>
83+
<body>
84+
I can add: {{ 1+2 }}.
85+
<script src="angular.js"></script>
86+
</body>
87+
</html>
88+
```
89+
90+
This will ensure that all services in your application are properly annotated.
91+
See the {@link guide/di#using-strict-dependency-injection dependancy injection strict mode} docs
92+
for more.
7693

7794

7895
## Manual Initialization

0 commit comments

Comments
 (0)