import { Directive , Output , HostListener , EventEmitter } from '@angular/core' ; import { WizardComponent } from '../components/wizard.component' ; author Marc Arndt
  @ Directive ( { selector : '[nextStep]' , } ) export class NextStepDirective { type { EventEmitter } @ Output ( ) public finalize = new EventEmitter ( ) ; param wizard constructor ( private wizard ) { } /**
     * Listener method for `click` events on the component with this directive.
     * After this method is called the wizard will try to transition to the next step
     */ @ HostListener ( 'click' , [ '$event' ] ) onClick ( ) { if ( this . wizard . canGoToNextStep ( ) ) { this . finalize . emit ( ) ; this . wizard . goToNextStep ( ) ; } } }