import { Directive , HostListener , Input } from '@angular/core' ; import { Params } from '@angular/router' ; import { ModalNavigationService } from '../../components/modal/services/modal-navigation.service' ; @ Directive ( { selector : `[kirbyModalRouterLink]` , } ) export class ModalRouterLinkDirective { constructor ( private modalNavigationService ) { } @ Input ( 'kirbyModalRouterLink' ) path : string | string [ ] ; @ Input ( 'kirbyModalQueryParams' ) queryParams ? : Params ; @ HostListener ( 'click' ) onClick ( ) { this . modalNavigationService . navigateToModal ( this . path , typeof this . queryParams !== 'string' ? this . queryParams : null ) ; return false ; } }