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) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -