title: p-dialog onHide not working in angular 2 component - primeng
body: <p>I'm using primeng in an angular 2 application and facing this issue <a href="https://stackoverflow.com/questions/43848250/how-to-call-angular-function-when-click-p-dialog-closex-button">(stackoverflow question)</a></p>
  
  <p>Although the plunkr provided in the accepted answer works but it doesn't in my scenario. I have a separate component that loads the  based on an input from the parent component. I want to toggle the visibility flag when the child component is closed/hidden.</p>
  
  <p>Here's the code snippet </p>
  
  <pre><code> &lt;p-dialog header="Assets Management" [(visible)]="showDialog" modal="modal" [closable]="true" (onHide)="close()" appendTo="body"&gt;
            .. some content ..
    &lt;/p-dialog&gt;
  </code></pre>
  
  <p>In component, I have:</p>
  
  <pre><code>@Component({
      selector: 'view-car-colors',
      templateUrl: '/view-car-colors.html',
      inputs: ['showDialog'],
      outputs: ["onCloseDialog"],
  })
  export class ViewCarColorsComponent {
      private showDialog: boolean = false;    //default close
      private onCloseDialog: EventEmitter&lt;any&gt; = new EventEmitter();
  
      public close(): void {
          this.showDialog = false;
          //emit this to its parent
          this.onCloseDialog.emit({ hasChanges: true });
      }
  }
  </code></pre>
  
  <p>And finally in my parent component, I am calling it like:</p>
  
  <pre><code>&lt;view-car-colors [showDialog]="showCarColorsDialog" (onCloseDialog)="onCarColorsCloseDialog($event)"&gt;&lt;/view-car-colors&gt;
  </code></pre>
  
  <p>Where <code>showCarColorsDialog</code> is changed based on a button click.</p>
  
  <pre><code>private onCarColorsCloseDialog($event: any): void {
      this.showCarColorsDialog = false;
      if ($event.hasChanges) {
          //fetch the changes again
          this.getCarColors();
      }
  }
  </code></pre>
  
  <p>I have used the primeng controls on multiple places and they all work fine but just has this issue so I'm sure it can't be because of the version.</p>