This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -41,3 +41,35 @@ The page should reload and the debug information should now be available.
41
41
42
42
For more see the docs pages on {@link ng.$compileProvider#debugInfoEnabled `$compileProvider`}
43
43
and {@link angular.reloadWithDebugInfo `angular.reloadWithDebugInfo`}.
44
+
45
+ ## Strict DI Mode
46
+
47
+ Using strict di mode in your production application will throw errors when a injectable
48
+ function is not
49
+ {@link di#dependency-annotation annotated explicitly}. Strict di mode is intended to help
50
+ you make sure that your code will work when minified. However, it also will force you to
51
+ make sure that your injectable functions are explicitly annotated which will improve
52
+ angular's performance when injecting dependencies in your injectable functions because it
53
+ doesn't have to dynamically discover a function's dependencies. It is recommended to
54
+ automate the explicit annotation via a tool like
55
+ [ng-annotate](https://github.com/olov/ng-annotate) when you deploy to production (and enable
56
+ strict di mode)
57
+
58
+ To enable strict di mode, you have two options:
59
+
60
+ ```html
61
+ <div ng-app="myApp" ng-strict-di>
62
+ <!-- your app here -->
63
+ </div>
64
+ ```
65
+
66
+ or
67
+
68
+ ```js
69
+ angular.bootstrap(document, ['myApp'], {
70
+ strictDi: true
71
+ });
72
+ ```
73
+
74
+ For more information, see the
75
+ {@link di#using-strict-dependency-injection DI Guide}.
You can’t perform that action at this time.
0 commit comments