Skip to content

Commit

Permalink
chore(typeahead): change to one-way binding for position
Browse files Browse the repository at this point in the history
- Change position to one-way binding to reduce an unnecessary $watch

chore(typeahead): add bind once to id attr
  • Loading branch information
wesleycho committed Jun 12, 2015
1 parent ca07ad7 commit 49e73a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
matches:'=',
query:'=',
active:'=',
position:'=',
position:'&',
select:'&'
},
replace:true,
Expand Down
4 changes: 2 additions & 2 deletions template/typeahead/typeahead-popup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+'px', left: position.left+'px'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">
<li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">
<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position().top+'px', left: position().left+'px'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">
<li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{::match.id}}">
<div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>
</li>
</ul>

0 comments on commit 49e73a8

Please sign in to comment.