angular2-di-decorators
v0.0.1
Published
ecmascript decorators for angular2 dependency injection
Downloads
2
Readme
angular2-di-decorators
This project will be a collection of decorators to make it easier to use the dependency inject system of angular2 with javascript decorators.
Note: this is only necessary because javascript decorators do not support parameter decorators
Installation
npm install --save angular2-di-decorators
Usage
import {Component} from 'angular2/core';
import Service from "./service";
import { InjectParameters } from "angular2-di-decorators";
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>',
providers: [Service]
})
@InjectParameters([Service])
export default class AppComponent {
constructor(service) {
this.service = service;
}
}