Bind click event to a dynamic element created whitin a directive


#1

Hi guys, I am facing this problem.
I’ve created a directive to allow me to clear a text input. Basically, when you start to type into the input field, the classic “X” icon appears on the right of the textbox. When you click it, the model is erased.
Now, When I created and tested the directive, I did it using plunker, and I included by mistake a very old ionic version (1.0.0-beta.5). In this scenario, the directive works like a charm.

When I moved the directive into my application, I discovered that the click event I bind doesn’t fire.So I forked the plunker and I used an updated ionic version (1.0.1), and in this case the click doesn’t work (but the dblclick does…doh!).

Does anyone knows how to fix it?
Thanks!


#2

Hello! You can see my Pen http://codepen.io/Floky87/pen/bVopyZ where same problem solved.