Event Emission Issue in the ChildComponent (Angular7)

Event Emission Issue in the ChildComponent (Angular7)

Lakshmi SLakshmi S Posts: 5Questions: 3Answers: 0

I have written a mouseover event for a div in the parentcomponent called ListComponent. I'm calling a method a called enter($event) on mouseover/mouseenter. In the method I have emitted like this this.hovereditem.emit(i). In chicldComponent I want to display a delete icon in a row where user hovers each list item . So I have written a function calling of emitted one from the ParentComponent like this
<div (hovereditem) = "enter($event)"> {{x.id}} </div> <div > {{x.desc}} </div>
IN the ts file ,

enter(event){
  alert("event got from parent");
}

But nothing is getting triggered. Response will be highly appreaciated.. Thanks in advance!!!!

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @Lakshmi S ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.