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

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -