Skip to content

Instantly share code, notes, and snippets.

View jorisbertomeu's full-sized avatar

Joris Bertomeu jorisbertomeu

View GitHub Profile
@markleusink
markleusink / draggable.directive.ts
Last active January 25, 2023 13:42
Angular directive to make ngx-bootstrap modals draggable
import { Directive, ElementRef, HostListener, AfterViewInit } from '@angular/core';
/*
* Directive to add 'drag' support to Ngx Bootstrap modals (https://github.com/valor-software/ngx-bootstrap).
* Based on this library to enable drag support for an ng-bootstrap modal: https://github.com/mattxu-zz/ngb-modal-draggable
*
* Enable by adding the directive to the modal-header element, e.g.:
*
* <div class="modal-header" ngxModalDraggable> </div>
*/