javascript - binding a click event on a directive's child element -


More angle delusions, that is, why can not I divide an element of a child's instruction into a click event?

  app.directive ('expandingTile', [function () {return {restrict: 'A', link: function (scope, amm, ethers) {elem.bind ('click', Function () {console.log ('elem hit!');}); Elem.find ('div # closebtn'). Bind ('click', function () {console.log ('found child hit!' )}}}}}}}]);    

Try to use this

link: function (scope, element) {$ timeout (function () {element.on ('click', '#ind', function () {console.log ('inside first child's event handler) Do not forget to inject timeout in the directive.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -