title: TypeError: _this.flashMessagesService.show is not a function
body: <p>Trying to use angular2-flash-messages and getting the console error _this.flashMessagesService.show is not a function</p>
  
  <p>Followed steps per <a href="https://github.com/moff/angular2-flash-messages" rel="nofollow noreferrer">https://github.com/moff/angular2-flash-messages</a>  </p>
  
  <p>app.modules.ts</p>
  
  <pre><code>import { FlashMessagesModule } from 'angular2-flash-messages';
  
  imports: [
      BrowserModule,
      FormsModule,
      FlashMessagesModule.forRoot(),
      RouterModule.forRoot(appRoutes)
  </code></pre>
  
  <p>signin.component.ts has</p>
  
  <pre><code>import { FlashMessagesService } from 'angular2-flash-messages';
  </code></pre>
  
  <p>signin.component.ts constructor has:</p>
  
  <pre><code>constructor(
  private authService: AuthService,
  private router: Router,
  private flashMessagesService: FlashMessagesService
  ) { }
  
  onSubmit() {
  this.authService.signin(this.email, this.password)
  .then((res) =&gt; {
  this.flashMessagesService.show('You are signed in', {
  cssClass: 'alert-success', timeout: 4000
  });
  this.router.navigate(['/']);
  })
  .catch((err) =&gt; {
  this.flashMessagesService.show(err.message, {
  cssClass: 'alert-danger', timeout: 4000
  });
  this.router.navigate(['/signin']);
  });
  }
  </code></pre>
  
  <p>and get the error _this.flashMessagesService.show is not a function</p>