Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 67e9d23

Browse files
refactor(typeahead): avoid string manipulation for DOM elements
1 parent 91ac17c commit 67e9d23

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/typeahead/typeahead.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
5353
var onSelectCallback = $parse(attrs.typeaheadOnSelect);
5454

5555
//pop-up element used to display matches
56-
var popUpEl = angular.element(
57-
"<typeahead-popup " +
58-
"matches='matches' " +
59-
"active='activeIdx' " +
60-
"select='select(activeIdx)' "+
61-
"query='query' "+
62-
"position='position'>"+
63-
"</typeahead-popup>");
56+
var popUpEl = angular.element('<typeahead-popup></typeahead-popup>');
57+
popUpEl.attr({
58+
matches: 'matches',
59+
active: 'activeIdx',
60+
select: 'select(activeIdx)',
61+
query: 'query',
62+
position: 'position'
63+
});
6464

6565
//create a child scope for the typeahead directive so we are not polluting original scope
6666
//with typeahead-specific data (matches, query etc.)

0 commit comments

Comments
 (0)