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

Commit

Permalink
fix(chips): item name in autcomplete
Browse files Browse the repository at this point in the history
Defer to a function as the item name expression is nested in contact chips.

fixes #4109

closes #4111
  • Loading branch information
Ty Potter authored and Robert Messerle committed Aug 17, 2015
1 parent b6e1098 commit dc5357d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/chips/js/contactChipsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ MdContactChipsCtrl.prototype.queryContact = function(searchText) {
};


MdContactChipsCtrl.prototype.itemName = function(item) {
return item[this.contactName];
};


MdContactChipsCtrl.prototype.filterSelectedContacts = function(contact) {
return this.contacts.indexOf(contact) == -1;
};
2 changes: 1 addition & 1 deletion src/components/chips/js/contactChipsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
md-selected-item="$mdContactChipsCtrl.selectedItem"\
md-search-text="$mdContactChipsCtrl.searchText"\
md-items="item in $mdContactChipsCtrl.queryContact($mdContactChipsCtrl.searchText)"\
md-item-text="$mdContactChipsCtrl.mdContactName"\
md-item-text="$mdContactChipsCtrl.itemName(item)"\
md-no-cache="true"\
md-autoselect\
placeholder="{{$mdContactChipsCtrl.contacts.length == 0 ?\
Expand Down

0 comments on commit dc5357d

Please sign in to comment.