I have three lines of similar code in multiple directive, which is actually doing some bind an event handler to the "focus".
var ele = $(event.target);
$($(event.target)).attr('tabindex', -1);
$(ele).trigger('focus');
this is creating code duplication issue, creating a service or factory method is not right way, as because i am dealing with DOM manipulation.
is there any way where i can make common method and pass my target and run above code to avoid code duplication.
requireoption in DDO?focusbinding$(event.target).attr('tabindex', -1);.