Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67497

Making image appear using *ngIf

$
0
0

I'm trying to display image one when clicks are < 5. image two when clicks are < 10. Struggling to correctly use *ngIf. Can anyone help me or point me in the right direction please?

html

<div class="test" (click) = "testFunction()"> </div>
  <img src="assets/one.jpg">
  <img src="assets/two.png">
  <img src="assets/three.jpg">

  {{clicks}}

  <button (click) = "clearFunction()"> clear! </button>

ts

 clicks: number = 0;

 testFunction() {
  this.clicks += 1;
}

Viewing all articles
Browse latest Browse all 67497

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>