In angular2, how to call a function inside an element without mouse event?
<p>Below is part of code in parent component, I already get the enable value from eventEmitter in its child component, which is enable=true.</p>

<pre><code>&lt;img src="{{currentImg}}" alt="Play Image not found" (click)="onMouseClick()"&gt;
&lt;pause-button (isPauseBtnClicked)="enable = $event"&gt;&lt;/pause-button&gt;
status is: {{enable}}
</code></pre>

<p>Then how can I assign a value for currentImg="someImg.png" after it listened the eventEmitter(enable=true)? Should I write a function? if so, how can I call that function in img tag without any mouse event?</p>

<p>I konw with mouse click event, things becomes easier, currentImg can be assign a value inside function.</p>

<pre><code>onMouseClick() {
        this.currentImg = this.clickedImg;
    }
</code></pre>