0.0.1 • Published 8 years ago

angular2-di-decorators v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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;
  }
}

Example project

See angular2-di-decorators-example