You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ To see a demo go here: http://ghiden.github.io/angucomplete-alt
38
38
* Clear input by sending $broadcast from parent scope. Thanks to @Leocrest for #61.
39
39
* Override template with your own. When you use this feature, test throughly as it might break other features. Thanks to @sdbondi for #74.
40
40
* Show all items.
41
+
* Custom remote API handler which allows you to fully control how to communicate with your remote API. Thanks to @jbuquet
41
42
42
43
### Getting Started
43
44
Download the package, and include the dist/angucomplete-alt.min.js file in your page.
@@ -96,7 +97,6 @@ var app = angular.module('app', ["angucomplete-alt"]);
96
97
| pause | The time to wait (in milliseconds) before searching when the user enters new characters. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No | 400 |
97
98
| selected-object | Either an object in your scope or callback function. If you set an object, it will be two-way-bound data as usual. If you set a callback, it gets called when selection is made. [example](http://ghiden.github.io/angucomplete-alt/#example1)| Yes | selectedObject or objectSelectedCallback |
98
99
| remote-url | The remote URL to hit to query for results in JSON. angucomplete will automatically append the search string on the end of this, so it must be a GET request. [example](http://ghiden.github.io/angucomplete-alt/#example5)| No |http://myserver.com/api/users/find?searchstr=|
99
-
| get-remote-data-function | A function in the controller that would receive the string and some parameters like the timeout promise, and would return a promise with the request for the data | No | - |
100
100
| remote-url-data-field | The name of the field in the JSON object returned back that holds the Array of objects to be used for the autocomplete list. [example](http://ghiden.github.io/angucomplete-alt/#example5)| No | results |
101
101
| title-field | The name of the field in the JSON objects returned back that should be used for displaying the title in the autocomplete list. Note, if you want to combine fields together, you can comma separate them here (e.g. for a first and last name combined). If you want to access nested field, use dot to connect attributes (e.g. name.first). [example](http://ghiden.github.io/angucomplete-alt/#example1)| Yes | firstName,lastName |
102
102
| description-field | The name of the field in the JSON objects returned back that should be used for displaying the description in the autocomplete list. [example](http://ghiden.github.io/angucomplete-alt/#example6)| No | twitterUsername |
@@ -111,6 +111,7 @@ var app = angular.module('app', ["angucomplete-alt"]);
111
111
| remote-url-request-with-credentials | A boolean that accepts parameters with credentials. | No | true or false |
112
112
| remote-url-response-formatter | A function on the scope that will modify raw response from remote API before it is rendered in the drop-down. Useful for adding data that may not be available from the API. The specified function must return the object in the format that angucomplete understands. | No | addImageUrlToObject |
113
113
| remote-url-error-callback | A callback funciton to handle error response from $http.get | No | httpErrorCallbackFn |
114
+
| remote-api-handler | This gives a way to fully delegate handling of remote search API. This function takes user input string and timeout promise, and it needs to return a promise. For example, if your search API is based on POST, you can use this function to create your own http handler. See example below | No | - |
114
115
| clear-selected | To clear out input field upon selecting an item, set this attribute to true. [example](http://ghiden.github.io/angucomplete-alt/#example3)| No | true |
115
116
| override-suggestions | To override suggestions and set the value in input field to selectedObject. [example](http://ghiden.github.io/angucomplete-alt/#example4)| No | true |
116
117
| field-required | Set field to be required. Requirement for this to work is that this directive needs to be in a form. Default class name is "autocomplete-required". [example](http://ghiden.github.io/angucomplete-alt/#example8)| No | true |
@@ -150,6 +151,23 @@ To clear an angucomplete-alt input field, send this message with id of the direc
0 commit comments