mardi 19 juillet 2016

Ember generated action or jquery onclick

I have an ember application which works fine. But user's interaction does some DOM insertion like below...

$(.test).append(<a >Get Data</a>);

The problem is that Ember seems do not recognize that an action "getData" has been added to the DOM. Nothing is happening when I click the element. Any thoughts on this?

Another way I am trying to do is:

 //create the element
 $(.test).append(<a id="idnum">Get Data</a>);

 //make click listener
 $('#idnum').click(function(){
 console.log("get data");
}

my question is where should i place the code inside the component so the it can listen on the click event. Thanks.




Aucun commentaire:

Enregistrer un commentaire