diff --git a/src/typeahead/docs/readme.md b/src/typeahead/docs/readme.md index efd2dfd0fc..933cd99776 100644 --- a/src/typeahead/docs/readme.md +++ b/src/typeahead/docs/readme.md @@ -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)` $ _(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`)_ - diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 81492f03dc..baa3ac7f8a 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -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();