title: How to debug Angular Service which doesn't inject [construct] itself?
body: <p>I've got a very simply service:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { MdSnackBar, MdSnackBarConfig } from '@angular/material';
  
  @Injectable()
  export class AlertsService {
    alerts: string[];
  
    constructor(private snackBar: MdSnackBar) {
      this.alerts = [];
    }
  
    public add(alert: string, action?: string, config?: MdSnackBarConfig) {
      this.alerts.push(alert);
      // console.warn('AlertsService::alerts =', this.alerts, ';');
      this.snackBar.open(alert, action, config);
    }
  }
  </code></pre>
  
  <p>…and a module for its dep (<code>import: [</code>ed by 'app.module'):</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { CommonModule } from '@angular/common';
  import { MdSnackBarModule } from '@angular/material';
  
  @NgModule({
    imports: [
      CommonModule, MdSnackBarModule
    ],
    exports: [
      MdSnackBarModule
    ]
  })
  export class AlertsModule { }
  </code></pre>
  
  <p>The Service is listed in 'app.module':</p>
  
  <pre><code>@NgModule({
    declarations: [
      AppComponent
    ],
    imports: [
      CommonModule,
      BrowserModule,
      FormsModule,
      HttpModule,
      BrowserAnimationsModule,
      SomeComp1Module,
      AlertsModule
    ],
    providers: [
      AlertsService
    ],
    bootstrap: [AppComponent]
  })
  export class AppModule {
  }
  </code></pre>
  
  <p>It's used like so:</p>
  
  <pre><code>@Component({
    selector: 'app-some-comp1',
    templateUrl: './some-comp1.component.html'
  })
  export class SomeComp1Component {
    constructor(private alertsService: AlertsService) {
        this.alertsService.add('SomeComp1Component');
    }
  }
  </code></pre>
  
  <h3>Bug</h3>
  
  <pre><code>TypeError: this.alerts is undefined
  </code></pre>
  
  <p>Making <code>alerts</code> static, then gives me: <code>TypeError: this.snackBar is undefined</code>.</p>
  
  <p><a href="https://github.com/AlecTaylor/material-alerts-ng" rel="nofollow noreferrer">My test-case</a> doesn't replicate the bug. Clearly <code>AlertsService</code> isn't being constructed/inject here. <strong>How do I debug the injector?</strong></p>