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

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -