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

Commit 49e73a8

Browse files
committed
chore(typeahead): change to one-way binding for position
- Change position to one-way binding to reduce an unnecessary $watch chore(typeahead): add bind once to id attr
1 parent ca07ad7 commit 49e73a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/typeahead/typeahead.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
357357
matches:'=',
358358
query:'=',
359359
active:'=',
360-
position:'=',
360+
position:'&',
361361
select:'&'
362362
},
363363
replace:true,

Diff for: template/typeahead/typeahead-popup.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<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()}}">
2-
<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}}">
1+
<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()}}">
2+
<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}}">
33
<div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>
44
</li>
55
</ul>

0 commit comments

Comments
 (0)