Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit dc5357d

Browse files
Ty PotterRobert Messerle
authored andcommitted
fix(chips): item name in autcomplete
Defer to a function as the item name expression is nested in contact chips. fixes #4109 closes #4111
1 parent b6e1098 commit dc5357d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/chips/js/contactChipsController.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ MdContactChipsCtrl.prototype.queryContact = function(searchText) {
2424
};
2525

2626

27+
MdContactChipsCtrl.prototype.itemName = function(item) {
28+
return item[this.contactName];
29+
};
30+
31+
2732
MdContactChipsCtrl.prototype.filterSelectedContacts = function(contact) {
2833
return this.contacts.indexOf(contact) == -1;
2934
};

src/components/chips/js/contactChipsDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
md-selected-item="$mdContactChipsCtrl.selectedItem"\
5959
md-search-text="$mdContactChipsCtrl.searchText"\
6060
md-items="item in $mdContactChipsCtrl.queryContact($mdContactChipsCtrl.searchText)"\
61-
md-item-text="$mdContactChipsCtrl.mdContactName"\
61+
md-item-text="$mdContactChipsCtrl.itemName(item)"\
6262
md-no-cache="true"\
6363
md-autoselect\
6464
placeholder="{{$mdContactChipsCtrl.contacts.length == 0 ?\

0 commit comments

Comments
 (0)