Skip to content

Commit 85f0764

Browse files
chicoxyzzypassy
authored andcommitted
fix(docs): add decorator generator description
Add decorator generator description to readme.md
1 parent 38a872b commit 85f0764

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Available generators:
3232
* [angular:filter](#filter)
3333
* [angular:route](#route)
3434
* [angular:service](#service)
35+
* [angular:decorator] (#decorator)
3536
* [angular:view](#view)
3637

3738
**Note: Generators are to be run from the root directory of your app.**
@@ -146,6 +147,24 @@ angular.module('myMod').service('myService', function () {
146147

147148
You can also do `yo angular:factory`, `yo angular:provider`, `yo angular:value`, and `yo angular:constant` for other types of services.
148149

150+
### Decorator
151+
Generates an AngularJS service decorator.
152+
153+
Example:
154+
```bash
155+
yo angular:decorator serviceName
156+
```
157+
158+
Produces `app/scripts/decorators/serviceNameDecorator.js`:
159+
```javascript
160+
angular.module('myMod').config(function ($provide) {
161+
$provide.decorator('serviceName', function ($delegate) {
162+
// ...
163+
return $delegate;
164+
});
165+
});
166+
```
167+
149168
## Options
150169
In general, these options can be applied to any generator, though they only affect generators that produce scripts.
151170

0 commit comments

Comments
 (0)