jquery - Instead of $.closest in Angularjs -
i want implement code in directive in jqlite doesn't work how should done?
var thiscell = element.closest('.sampleclass');
you have implement functionality manually, example:
var thiscell = (function closest(e, classname) { if (e[0].nodename == "html") { return null; } else if (e.hasclass(classname)) { return e; } else { return closest(e.parent(), classname); } })(element, "sampleclass");
Comments
Post a Comment