GitHub

DaffModalComponent

import { DaffModalComponent } from '@daffodil/design/modal'
@Component()
class DaffModalComponent implements AfterContentInit, AfterViewInit, DaffOpenable {
  @HostBinding() modalClass: true
  @HostBinding() role: 'dialog'
  @HostBinding() ariaModal: true
  @HostBinding() 
  get ariaLabelledBy(): string
  set ariaLabelledBy(value): string
  animationCompleted: EventEmitter<any>
  closedAnimationCompleted: EventEmitter<any>
  ngAfterContentInit()
  ngAfterViewInit()
  attachContent(portal: ComponentPortal<any>): any
  @HostBinding() 
  get fadeState(): string
  @HostListener() animationDone(e: AnimationEvent_2)
  get open()
  reveal()
  hide()
  toggle()
}
Selector: 'daff-modal'

Properties

Name Type Description
modalClass true

Sets a class of .daff-modal to the host element.

role 'dialog'

Sets the role to dialog.

ariaModal true

Sets aria-modal to true.

ariaLabelledBy string

The aria-labelledby for the modal. This is set by the id of DaffModalTitleDirective when it is used.

animationCompleted EventEmitter<any>

Event fired when the close animation is completed.

closedAnimationCompleted EventEmitter<any>

Event fired when the close animation is completed.

ngAfterContentInit
ngAfterViewInit
attachContent any

Helper method to attach portable content to modal.

fadeState string

Animation hook that controls the entrance and exit animations of the modal.

animationDone

Animation event that can used to hook into when animations are fully completed. We use this in the DaffModalService to determine when to actually remove the dynamically rendered element from the DOM so that the animation does not clip as the element is removed.

open
reveal

Reveals the modal

hide

Hides the modal

toggle

Toggles the visibility of the modal