Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142239

How to call a function only once inside mouseover function in typescript?

$
0
0

I am using angular7. In my application I am showing a list of places. when i hover on any one place I am calling an ajax function to store that value in database.

But when I hover on any one element, that ajax function get called multiple times. I want to call that function only once.

Here is my angular code:

<div *ngFor="let place of mapData" (mouseover)="displayTagInfo($event)">
  <div class="filter-name">{{place.name}}</div>
</div>

Viewing all articles
Browse latest Browse all 142239

Trending Articles



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