valor-software/angular2-bootstrap

View on GitHub
demo/src/app/components/+modal/demos/auto-shown/auto-shown.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Component, ViewChild } from '@angular/core';
import { ModalDirective } from 'ngx-bootstrap/modal';

@Component({
  selector: 'demo-modal-auto-shown',
  templateUrl: './auto-shown.html'
})
export class DemoAutoShownModalComponent {
  @ViewChild('autoShownModal') autoShownModal: ModalDirective;
  isModalShown: boolean = false;

  showModal(): void {
    this.isModalShown = true;
  }

  hideModal(): void {
    this.autoShownModal.hide();
  }

  onHidden(): void {
    this.isModalShown = false;
  }
}