Binding click event to child element inside directive of AngularJS
问题 I have following directive. (function () { 'use strict'; angular.module('ap.App') .directive('clearCancelFinishButtonsHtml', function () { return { scope: { clearFunction: '=' }, replace: true, templateUrl: 'directives/clearCancelFinishButtons.html', link: function (scope, el, attrs) { var clear= angular.element(el.find('button.clear')); console.log(el.find('.clear')); clear.bind("click", function () { alert("here"); }); } } }); })(); and it is pointing to the html file as follows <div class=