> > Thank you. > > However, I need this in ES5, preferably in the following form: > > app.directive('focusNext', function() { > return { > restrict: 'A', > link: function(scope, el) { > el.bind('keydown', function(event) { > if (event.keyCode === 13) { > > // 1. look for the next element here > // 2. set focus to element > > } > }); > } > }; > }); > > > I compiled your code with Babel, but the TraverseAndFindFocusableElements > it yields is a bit confusing, and doesn't work (regeneratorRuntime is not > defined). Can you show me a simple way to find the index of the directives' > element inside the among the other items with the same focus-next directive? > > I'm able to get the other items document, but none of the items seem to > match "el". > > var els = document.querySelectorAll('[focus-next]') > > for(var i in els) { > console.log(els[i]==el) // all of these return false > } > > As you can probably tell, I'm very much a noob with Angular. > Cheers. Esa
-- You received this message because you are subscribed to the Google Groups "Angular" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.