GitHub

DaffModalComponent

class

import { DaffModalComponent } from '@daffodil/design/modal'

@Component()
class DaffModalComponent implements AfterContentInit, AfterViewInit, OnDestroy, DaffOpenable {
  ariaLabelledBy: string
  animationCompleted: EventEmitter<any> = new EventEmitter<any>()
  readonly closedAnimationCompleted$: this._closedAnimationCompleted.asObservable() = this._closedAnimationCompleted.asObservable()
  get open(): boolean

  @Input() @HostBinding() toggled: boolean = false

  attachContent(portal: ComponentPortal<any>): any
  @HostListener() animationDone(e: AnimationEvent): void
  reveal(): void
  hide(): void
  toggle(): void
}

Outputs

toggled
boolean
Default –
Description

Controls whether the component is open.

Properties

ariaLabelledBy
string
Default –
Description
animationCompleted
EventEmitter<any>
Defaultnew EventEmitter<any>()
Description

Event fired when the close animation is completed.

closedAnimationCompleted$
this._closedAnimationCompleted.asObservable()
Defaultthis._closedAnimationCompleted.asObservable()
Description

Observable that emits when the close animation is completed.

open
boolean
Default –
Description

() Methods

attachContent
any

Helper method to attach portable content to modal.

Parameters
Parameterportal: ComponentPortal
Description
animationDone
void

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.

Parameters
Parametere: AnimationEvent
Description
reveal
void

Reveals the modal

hide
void

Hides the modal

toggle
void

Toggles the visibility of the modal