' +'
', link: function(scope, el, attr){ var $listContainer = angular.element( el[0].querySelectorAll('.search-item-list')[0] ); el.find('input').bind('focus',function(){ $listContainer.addClass('show'); }); el.find('input').bind('blur',function(){ $timeout(function(){ $listContainer.removeClass('show') }, 200); }); scope.chooseItem = function( item ){ scope.search = item.name; $listContainer.removeClass('show'); } } }});