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

make matches available to the typeahead-on-select callback #6406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/typeahead/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ This directive works with promises, meaning you can retrieve matches using the `
_(Default: `null`)_ -
A callback executed when a `keyup` event that might trigger a selection occurs. Selection will only occur if this function returns true.

* `typeahead-on-select($item, $model, $label, $event)`
* `typeahead-on-select($item, $model, $label, $event, $matches)`
<small class="badge">$</small>
_(Default: `null`)_ -
A callback executed when a match is selected. $event can be undefined if selection not triggered from a user event.
A callback executed when a match is selected. $event can be undefined if selection not triggered from a user event. $matches is an array of match objects.

* `typeahead-popup-template-url`
_(Default: `uib/template/typeahead/typeahead-popup.html`)_ -
Expand Down
3 changes: 2 additions & 1 deletion src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
$item: item,
$model: model,
$label: parserResult.viewMapper(originalScope, locals),
$event: evt
$event: evt,
$matches: scope.matches
});

resetMatches();
Expand Down