You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: If `ng-annotate` detects injection has already been made (e.g. `@ngInject` was detected), it will not duplicate the `$inject` code.
@@ -1979,15 +1979,19 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
1979
1979
functionAvengersController() { }
1980
1980
```
1981
1981
1982
-
### Factory Names
1982
+
### Factory and Service Names
1983
1983
###### [Style [Y125](#style-y125)]
1984
1984
1985
-
- Use consistent names for all factories named after their feature. Use camel-casing for services and factories. Avoid prefixing factories and services with `$`.
1985
+
- Use consistent names for all factories and services named after their feature. Use camel-casing for services and factories. Avoid prefixing factories and services with `$`. Only suffix service and factories with `Service` when it is not clear what they are (i.e. when they are nouns).
1986
1986
1987
1987
*Why?*: Provides a consistent way to quickly identify and reference factories.
1988
1988
1989
1989
*Why?*: Avoids name collisions with built-in factories and services that use the `$` prefix.
1990
1990
1991
+
*Why?*: Clear service names such as `logger` do not require a suffix.
1992
+
1993
+
*Why?*: Service names such as `avengers` are nouns and require a suffix and should be named `avengersService`.
1994
+
1991
1995
```javascript
1992
1996
/**
1993
1997
* recommended
@@ -2001,6 +2005,26 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
0 commit comments