GeezerVison is showing github.com — docs(guide): remove redundancy in providers guide · wangjunji/angular.js@88765d5
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: docs/content/guide/providers.ngdoc +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -132,9 +132,11 @@ In the code above, we see how the `apiToken` service is defined via the Factory |
132 | 132 | on the `clientId` service. The factory service then uses NSA-proof encryption to produce an authentication |
133 | 133 | token. |
134 | 134 |
|
135 | | -Note: It is best practice to name the factory functions as `<serviceId>Factory` |
| 135 | +<div class="alert alert-success"> |
| 136 | +**Best Practice:** name the factory functions as `<serviceId>Factory` |
136 | 137 | (e.g. apiTokenFactory). While this naming convention is not required, it helps when navigating the code base |
137 | 138 | or looking at stack traces in the debugger. |
| 139 | +</div> |
138 | 140 |
|
139 | 141 | Just like with Value recipe, Factory recipe can create a service of any type, whether it be a |
140 | 142 | primitive, object literal, function, or even an instance of a custom type. |
@@ -193,8 +195,7 @@ that would mess with the teachers. |
193 | 195 |
|
194 | 196 | ## Provider Recipe |
195 | 197 |
|
196 | | -There are two more recipe types left to cover. They are both fairly specialized and are used |
197 | | -infrequently. As already mentioned in the intro, the Provider recipe is the core recipe type and |
| 198 | +As already mentioned in the intro, the Provider recipe is the core recipe type and |
198 | 199 | all the other recipe types are just syntactic sugar on top of it. It is the most verbose recipe |
199 | 200 | with the most abilities, but for most services it's overkill. |
200 | 201 |
|
|