Visual Studion 2015 and Angular2 Beta 2 dependency injection
<p>My environment is VS2015 with TypeScript 1.7.3, Angular2 Beta 2, target ECMA 5. I've modified the csproj file to include  <code>TypeScriptExperimentalDecorators = true</code>.</p>

<p>I'm working on the Angular2 <a href="https://angular.io/docs/ts/latest/tutorial/toh-pt4.html" rel="nofollow">tutorial</a> and can not get dependency injection working as documented.  I can only get DI to work when I include <code>@Inject</code> in the <code>AppComponent</code> class constructor. If I don't include <code>@Inject</code> I receive this error - </p>

<blockquote>
  <p>EXCEPTION: Cannot resolve all parameters for AppComponent(?). Make sure they all have valid type or annotations.</p>
</blockquote>

<p>I did not include the code in this post because its the same as the tutorial. I did try modifying boot.ts as follows: </p>

<pre><code>bootstrap(AppComponent, [HeroService]);
</code></pre>

<p>but I still get the error. Has anyone else run into this?</p>

<p>The <code>HeroService</code> is decorated with <code>@Injectable</code>:</p>

<pre><code>import {Hero} from './hero';
import {HEROES} from './mock-heroes';
import {Injectable} from '../node_modules/angular2/core';

@Injectable()
export class HeroService {
    heroes: Hero[];

    getHeroes() {
        return Promise.resolve(HEROES);
    }
   //  See the "Take it slow" appendix
    getHeroesSlowly() {
        return new Promise&lt;Hero[]&gt;(resolve =&gt;
            setTimeout(() =&gt; resolve(HEROES), 2000) // 2 seconds
        );
    }
}
</code></pre>

<p>app.component.ts</p>

<pre><code>import {Component, OnInit, Inject} from '../node_modules/angular2/core';
import {Hero} from './hero';
import {HeroDetailComponent} from './hero-detail.component';
import {HeroService} from './hero.service';

@Component({
    selector: 'my-app',
    template: `
        &lt;h1&gt;{{title}}&lt;/h1&gt;
        &lt;my-hero-detail [hero]="selectedHero"&gt;&lt;/my-hero-detail&gt;
        &lt;h2&gt;My Heroes&lt;/h2&gt;
        &lt;ul class="heroes"&gt;
            &lt;li *ngFor="#hero of heroes" 
                (click)="onSelect(hero)" 
                [class.selected]="hero === selectedHero"&gt;
                &lt;span class="badge"&gt;{{hero.id}}&lt;/span&gt; {{hero.name}}
            &lt;/li&gt;
        &lt;/ul&gt;      
        `
    ,directives: [HeroDetailComponent]
    ,providers: [HeroService]
})

export class AppComponent implements OnInit {
    public title = 'Tour of Heroes';
    public heroes: Hero[];
    public selectedHero: Hero;

    constructor(private _heroService: HeroService) { 
   // constructor( @Inject(HeroService) private _heroService: HeroService) {

    }
    getHeroes() {
        this._heroService.getHeroes().then(heroes =&gt; this.heroes = heroes);
    }
    ngOnInit() {
        this.getHeroes();
    }
    onSelect(hero: Hero) { this.selectedHero = hero; }
}
</code></pre>