import { Directive , HostListener } from '@angular/core' ; import { WizardComponent } from '../components/wizard.component' ; author Marc Arndt
  @ Directive ( { selector : '[previousStep]' , } ) export class PreviousStepDirective { 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 previous step
     */ @ HostListener ( 'click' , [ '$event' ] ) onClick ( ) { if ( this . wizard . canGoToPreviousStep ( ) ) { this . wizard . goToPreviousStep ( ) ; } } }