message: chore(demo): fixed modals events sample
diff: -import { Component, TemplateRef } from '@angular/core';
  +import { ChangeDetectorRef, Component, TemplateRef } from '@angular/core';
  import { BsModalService } from 'ngx-bootstrap/modal';
  import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
  import { Subscription } from 'rxjs/Subscription';
  +import { Observable } from 'rxjs/Observable';
  +
  +import 'rxjs/add/observable/combineLatest';
  @Component({
  selector: 'demo-modal-service-events',
  @@ -11,10 +14,20 @@ export class DemoModalServiceEventsComponent {
  modalRef: BsModalRef;
  subscriptions: Subscription[] = [];
  messages: string[] = [];
  - constructor(private modalService: BsModalService) {}
  +
  + constructor(private modalService: BsModalService, private changeDetection: ChangeDetectorRef) {
  + }
  openModal(template: TemplateRef<any>) {
  this.messages = [];
  +
  + const _combine = Observable.combineLatest(
  + this.modalService.onShow,
  + this.modalService.onShown,
  + this.modalService.onHide,
  + this.modalService.onHidden
  + ).subscribe(() => this.changeDetection.markForCheck());
  +
  this.subscriptions.push(
  this.modalService.onShow.subscribe((reason: string) => {
  this.messages.push(`onShow event has been fired`);
  @@ -27,23 +40,20 @@ export class DemoModalServiceEventsComponent {
  );
  this.subscriptions.push(
  this.modalService.onHide.subscribe((reason: string) => {
  - this.messages.push(
  - `onHide event has been fired${reason
  - ? ', dismissed by ' + reason
  - : ''}`
  - );
  + const _reason = reason ? `, dismissed by ${reason}` : '';
  + this.messages.push(`onHide event has been fired${_reason}`);
  })
  );
  this.subscriptions.push(
  this.modalService.onHidden.subscribe((reason: string) => {
  - this.messages.push(
  - `onHidden event has been fired${reason
  - ? ', dismissed by ' + reason
  - : ''}`
  - );
  + const _reason = reason ? `, dismissed by ${reason}` : '';
  + this.messages.push(`onHidden event has been fired${_reason}`);
  this.unsubscribe();
  })
  );
  +
  + this.subscriptions.push(_combine);
  +
  this.modalRef = this.modalService.show(template);
  }
  