GitHub

DaffModalCloseDirective

The DaffModalCloseDirective is a helper directive that passes a click event to the button it's used with to close a modal. It needs to be implemented with the <button> HTML element to work. This helps to reduce code duplication.

import { DaffModalCloseDirective } from '@daffodil/design/modal'
@Directive()
class DaffModalCloseDirective {
  @HostListener() _onCloseModal(event: MouseEvent)
  @HostBinding() typeAttribute: 'button'
}
Selector: 'button[daffModalClose]'

Properties

Name Type Description
_onCloseModal

Event fired when the button the directive is attached to is clicked. This is used to close a modal.

typeAttribute 'button'

Sets the button type attribute to button.