title: Angular2 - pass variable with EventEmitter by timeout function to parent component
body: <p>I have issue with Event Emitter in child component.</p>
  
  <p>I want to pass variable with EventEmitter to parent component, but with usage timeout function. Now it's look like this:</p>
  
  <p>CHILD:</p>
  
  <pre><code>export class AlertSuccess implements OnChanges {
  
      @Input() success: SuccessCRM;
      @Output() emitCollapse:EventEmitter&lt;any&gt; = new EventEmitter();
  
      private info_ico: string = require('../../public/images/iconInfoTip.png');
      public state: boolean = false;
  
      constructor() {}
  
      collapseAlert () {
          let alert = document.getElementById('success');
          setTimeout(function() {
              console.log("BEFORE EMITTED STATE!!!!!: ", this.state );
              console.log(this.emitCollapse);
              this.emitCollapse.emit(this.state); 
          }, 500);
      }
  
      ngOnChanges(changes: SimpleChanges):void {
          console.log("CHANGES: ", this.success);
          this.collapseAlert();
      }
  }
  </code></pre>
  
  <p>In parent everything is normal, I have method which I passed via template.</p>
  
  <p>Emitter is working without timeout function. Please help me implement it into timeout!</p>
  
  <p>Regards 
  Bosper!</p>