https://github.com/bendrucker/angular-annotation-decorator
ES7 decorator for adding $inject annotations for Angular 1.x
https://github.com/bendrucker/angular-annotation-decorator
Last synced: 12 months ago
JSON representation
ES7 decorator for adding $inject annotations for Angular 1.x
- Host: GitHub
- URL: https://github.com/bendrucker/angular-annotation-decorator
- Owner: bendrucker
- License: mit
- Created: 2015-04-09T15:01:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T20:22:13.000Z (over 7 years ago)
- Last Synced: 2025-04-15T00:03:39.076Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-annotation-decorator [](https://travis-ci.org/bendrucker/angular-annotation-decorator)
ES7 decorator for adding `$inject` annotations for Angular 1.x.
## Installing
```sh
$ npm install angular-annotation-decorator
```
## Usage
```js
import inject from 'angular-annotation-decorator';
@inject('$http', '$q')
class MyService {
constructor ($http, $q) {
//
}
@inject('$log')
method ($log) {
//
}
}
```
You'll need to use an ESNext transpiler like [Babel](https://babeljs.io/) and [enable support for decorators](https://www.npmjs.com/package/babel-plugin-transform-decorators-legacy).