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.
| id | A unique ID for the field. [example](http://ghiden.github.io/angucomplete-alt/#example1)| Yes | members |
97
-
| placeholder | Placeholder text for the search field. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No | Search members |
98
-
| maxlength | Maxlength attribute for the search field. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No | 25 |
99
-
| 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 |
100
-
| selected-object | Either an object in your scope or callback function. If you set an object, it will be passed to the directive with '=' sign but it is actually one-way-bound data. So, setting it from your scope has no effect on input string. If you set a callback, it gets called when selection is made. To get attributes of the input from which the assignment was made, use this.$parent.$index within your function. [example](http://ghiden.github.io/angucomplete-alt/#example1)| Yes | selectedObject or objectSelectedCallback |
101
-
| 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=|
102
-
| 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 |
103
-
| 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 |
104
-
| 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 |
105
-
| image-field | The name of the field in the JSON objects returned back that should be used for displaying an image in the autocomplete list. [example](http://ghiden.github.io/angucomplete-alt/#example2)| No | pic |
106
-
| minlength | The minimum length of string required before searching. [example](http://ghiden.github.io/angucomplete-alt/#example1). If set to 0, it shows all items. It works both local and remote but is intended to use with local data. If used with remote API, it needs to return all items when query parameter is empty string. | No | 3 |
107
-
| input-name | Name for input field | No ||
108
-
| input-class | The classes to use for styling the input box. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No | form-control |
109
-
| match-class | If it is assigned, matching part of title is highlighted with given class style. [example](http://ghiden.github.io/angucomplete-alt/#example6)| No | highlight |
110
-
| local-data | The local data variable to use from your controller. Should be an array of objects. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No | countriesList |
111
-
| search-fields | The fields from your local data to search on (comma separate them). Each field can contain dots for accessing nested attribute. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No | title,description |
112
-
| remote-url-request-formatter | A function that takes a query string and returns parameter(s) for GET. It should take the query string as argument and returns a key-value object. [example](http://ghiden.github.io/angucomplete-alt/#example5)| No | Suppose if you need to send a query keyword and a timestamp to search API, you can write a function like this in the parent scope. $scope.dataFormatFn = function(str) { return {q: str, timestamp: +new Date()}; } |
113
-
| remote-url-request-with-credentials | A boolean that accepts parameters with credentials. | No | true or false |
114
-
| 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 |
115
-
| remote-url-error-callback | A callback funciton to handle error response from $http.get | No | httpErrorCallbackFn |
116
-
| 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 |-|
117
-
| 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 |
99
+
| Attribute | Description | Required | Binding| Example |
| id | A unique ID for the field. [example](http://ghiden.github.io/angucomplete-alt/#example1)| Yes |@ |members |
102
+
| placeholder | Placeholder text for the search field. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No |@ |Search members |
103
+
| maxlength | Maxlength attribute for the search field. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No |attribute |25 |
104
+
| 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 |
105
+
| selected-object | Either an object in your scope or callback function. If you set an object, it will be passed to the directive with '=' sign but it is actually one-way-bound data. So, setting it from your scope has no effect on input string. If you set a callback, it gets called when selection is made. To get attributes of the input from which the assignment was made, use this.$parent.$index within your function. [example](http://ghiden.github.io/angucomplete-alt/#example1)| Yes |= |selectedObject or objectSelectedCallback |
106
+
| 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=|
107
+
| 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 |
108
+
| 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 |
109
+
| 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 |
110
+
| image-field | The name of the field in the JSON objects returned back that should be used for displaying an image in the autocomplete list. [example](http://ghiden.github.io/angucomplete-alt/#example2)| No |@ |pic |
111
+
| minlength | The minimum length of string required before searching. [example](http://ghiden.github.io/angucomplete-alt/#example1). If set to 0, it shows all items. It works both local and remote but is intended to use with local data. If used with remote API, it needs to return all items when query parameter is empty string. | No |@ |3 |
112
+
| input-name | Name for input field | No |@ ||
113
+
| input-class | The classes to use for styling the input box. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No |@ |form-control |
114
+
| match-class | If it is assigned, matching part of title is highlighted with given class style. [example](http://ghiden.github.io/angucomplete-alt/#example6)| No |@ |highlight |
115
+
| local-data | The local data variable to use from your controller. Should be an array of objects. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No |= |countriesList |
116
+
| search-fields | The fields from your local data to search on (comma separate them). Each field can contain dots for accessing nested attribute. [example](http://ghiden.github.io/angucomplete-alt/#example1)| No |@ |title,description |
117
+
| remote-url-request-formatter | A function that takes a query string and returns parameter(s) for GET. It should take the query string as argument and returns a key-value object. [example](http://ghiden.github.io/angucomplete-alt/#example5)| No |= |Suppose if you need to send a query keyword and a timestamp to search API, you can write a function like this in the parent scope. $scope.dataFormatFn = function(str) { return {q: str, timestamp: +new Date()}; } |
118
+
| remote-url-request-with-credentials | A boolean that accepts parameters with credentials. | No |@ |true or false |
119
+
| 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 |
120
+
| remote-url-error-callback | A callback funciton to handle error response from $http.get | No |= |httpErrorCallbackFn |
121
+
| 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 |= ||
122
+
| 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 |
118
123
| override-suggestions | To override suggestions and set the value in input field to selectedObject. [example](http://ghiden.github.io/angucomplete-alt/#example4)| No | true |
119
-
| 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) If you need to validate more than one directives, you have to provide unique field-required-class for each directive. | No |true |
120
-
| field-required-class | Set custom class name for required. Unique class names need to be set when you have multiple directives to validate. | No| "match" |
121
-
| text-searching | Custom string to show when search is in progress. Set this to 'false' prevents text to show up. | No | "Searching for items..." |
122
-
| text-no-results | Custom string to show when there is no match. Set this to 'false' prevents text to show up. | No | "Not found" |
123
-
| initial-value | Initial value for component. If string, the internal model is set to the string value, if an object, the title-field attribute is used to parse the correct title for the view, and the internal model is set to the object. [example](http://ghiden.github.io/angucomplete-alt/#example9)| No | myInitialValue (object/string) |
124
-
| input-changed | A callback function that is called when input field is changed. To get attributes of the input from which the assignment was made, use this.$parent.$index within your function. [example](http://ghiden.github.io/angucomplete-alt/#example10)| No | inputChangedFn |
125
-
| auto-match | Allows for auto selecting an item if the search text matches a search results attributes exactly. [example](http://ghiden.github.io/angucomplete-alt/#example11)| No | true |
126
-
| focus-in | A function or expression to be called when input field gets focused. [example](http://ghiden.github.io/angucomplete-alt/#example12)| No| focusIn() |
127
-
| focus-out | A function or expression to be called when input field lose focus. [example](http://ghiden.github.io/angucomplete-alt/#example12)| No| focusOut() |
128
-
| disable-input | A model to control disable/enable of input field. [example page](http://ghiden.github.io/angucomplete-alt/#example13)| No| disableInput |
129
-
| template-url | Customize the markup of the autocomplete template. [example page](http://ghiden.github.io/angucomplete-alt/#example14)| No| "/my-custom-template.html" |
130
-
| focus-first | Automatically select the first match from the result list. | No | true |
124
+
| 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 | = | a variable holding true/false|
125
+
| field-required-class | Set custom class name for required. | No | @| "match" |
126
+
| text-searching | Custom string to show when search is in progress. Set this to 'false' prevents text to show up. | No |attribute |"Searching for items..." |
127
+
| text-no-results | Custom string to show when there is no match. Set this to 'false' prevents text to show up. | No |attribute |"Not found" |
128
+
| initial-value | Initial value for component. If string, the internal model is set to the string value, if an object, the title-field attribute is used to parse the correct title for the view, and the internal model is set to the object. [example](http://ghiden.github.io/angucomplete-alt/#example9)| No |= |myInitialValue (object/string) |
129
+
| input-changed | A callback function that is called when input field is changed. To get attributes of the input from which the assignment was made, use this.$parent.$index within your function. [example](http://ghiden.github.io/angucomplete-alt/#example10)| No |= |inputChangedFn |
130
+
| auto-match | Allows for auto selecting an item if the search text matches a search results attributes exactly. [example](http://ghiden.github.io/angucomplete-alt/#example11)| No |@ |true |
131
+
| focus-in | A function or expression to be called when input field gets focused. [example](http://ghiden.github.io/angucomplete-alt/#example12)|No | &| focusIn() |
132
+
| focus-out | A function or expression to be called when input field lose focus. [example](http://ghiden.github.io/angucomplete-alt/#example12)|No | &| focusOut() |
133
+
| disable-input | A model to control disable/enable of input field. [example page](http://ghiden.github.io/angucomplete-alt/#example13)|No | =| disableInput |
134
+
| template-url | Customize the markup of the autocomplete template. [example page](http://ghiden.github.io/angucomplete-alt/#example14)|No | attribute| "/my-custom-template.html" |
135
+
| focus-first | Automatically select the first match from the result list. | No |@ |true |
131
136
132
137
### Scrollbar
133
138
@@ -203,27 +208,6 @@ cd examples
203
208
python -m SimpleHTTPServer
204
209
```
205
210
206
-
### IE8
207
-
208
-
To use angucomplete-alt on IE8, take these steps:
209
-
210
-
1. Use angular 1.2 version.
211
-
2. Include polyfills es5-shim and JSON3
212
-
3. Comment out the promise chain and use bracket notation
0 commit comments