@hqjs/babel-plugin-add-type-metadata
Version:
Add plugin metadata
49 lines (37 loc) • 760 B
Markdown
# babel-plugin-add-type-metadata
Add types metadata
# Installation
```sh
npm install hqjs@babel-plugin-add-type-metadata
```
# Transformation
Plugin adds type metadata from constructor to classes to help Angular e.g.
```ts
...
import { MessageService } from './message.service';
export class HeroService {
constructor(private messageService: MessageService) { }
...
}
```
will turn into
```ts
...
import { MessageService } from './message.service';
export class HeroService {
static "ctorParameters"() {
return [{
"type": HeroService
}];
}
constructor(private messageService: MessageService) { }
...
}
```
that works nice with decorator plugin.