Skip to content

Commit 90bfe6a

Browse files
committed
fix: spread displayProperty to autocomplete
1 parent a3a7db4 commit 90bfe6a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/auto-complete.component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default {
3131
template: require('./auto-complete.template.html'),
3232
controller: AutoComplete,
3333
bindings: {
34+
displayProperty: '@',
3435
source: '<',
3536
matchClass: '<',
3637
visible: '=',

src/auto-complete.template.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
<li>
66
<a ng-if="$ctrl.path.length > 0"
77
ng-click="$ctrl.previous()">
8-
&lt;&nbsp;{{$ctrl.currentItem.title}}
8+
&lt;&nbsp;{{ $ctrl.currentItem[$ctrl.displayProperty] }}
99
</a>
1010
<span ng-if="$ctrl.path.length === 0">
11-
{{$ctrl.currentItem.title}}
11+
{{ $ctrl.currentItem[$ctrl.displayProperty] }}
1212
</span>
1313
</li>
1414
<li role="menuitem"
1515
class="menuitem"
1616
ng-repeat="item in $ctrl.currentItem.data track by item.code">
1717
<a ng-if="item.data && item.data.length > 0"
1818
ng-click="$ctrl.next(item)">
19-
{{item.title}}&nbsp;&gt;
19+
{{ item[$ctrl.displayProperty] }}&nbsp;&gt;
2020
</a>
2121
<a ng-if="!item.data || item.data.length <= 0"
2222
ng-click="$ctrl.addTag(item)">
23-
{{item.title}}
23+
{{ item[$ctrl.displayProperty] }}
2424
</a>
2525
</li>
2626
</ul>

src/input-tags.template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<input-tags-auto-complete source="$ctrl.suggestions"
1414
ng-if="$ctrl.maxLength > $ctrl.tags.length"
15+
display-property="$ctrl.displayProperty"
1516
on-tag-add="$ctrl.addTag(tag)"
1617
visible="$ctrl.autocompleteVisible"></input-tags-auto-complete>
1718

0 commit comments

Comments
 (0)