I have created a directive that disable all of the selected child elements like this :
app.directive('noeDisable', function () {
var linkFunction = function (scope, element, attributes) {
scope.text = attributes["=noeDisable"];
if (scope.text == 'true') {
$(element).find('input,button,a').attr("disabled", true);
}
};
return {
link: linkFunction
};
});
and it work well for this example: <div noe-disable="true"> ... </div>. but the problem is some of the child elements load later, for example after ajax call or when I have another angularjs directive inside parent element that add some child elements to its parent, so they wont be disabled !!!
How can I deal with this problem ?