A directive for generating tag input with autocomplete support on text input. Tag autocomplete has priority 800
Parameters:
Name | Type | Description |
---|---|---|
mac-tag-autocomplete-source |
String | Data to use. Source support multiple types:
|
mac-tag-autocomplete-value |
String | The value to be sent back upon selection (default "id") |
mac-tag-autocomplete-label |
String | The label to display to the users (default "name") |
mac-tag-autocomplete-model |
Expr | Model for autocomplete |
mac-tag-autocomplete-selected |
Array | The list of elements selected by the user (required) |
mac-tag-autocomplete-query |
String | The query parameter on GET command (defualt "q") |
mac-tag-autocomplete-delay |
Integer | Time delayed on fetching autocomplete data after keyup (default 800) |
mac-tag-autocomplete-placeholder |
String | Placeholder text of the text input (default "") |
mac-tag-autocomplete-disabled |
Boolean | If autocomplete is enabled or disabled (default false) |
mac-tag-autocomplete-on-success |
function | Function called on successful ajax request (Proxy attribute for macAutocomplete)
|
mac-tag-autocomplete-on-enter |
Expr | When autocomplete is disabled, this function is called on enter, Should return either string, object or boolean. If false, item is not added
|
mac-tag-autocomplete-clear-input |
Event | $broadcast message; clears text input when received |
mac-tag-autocomplete-blur |
expression | Callback function on blur
|
mac-tag-autocomplete-focus |
expression | Callback function on focus
|
mac-tag-autocomplete-keyup |
expression | Callback function on keyup
|
mac-tag-autocomplete-keydown |
expression | Callback function on keydown
|
mac-tag-autocomplete-keypress |
expression | Callback function on keypress
|
Examples
Basic example
<mac-tag-autocomplete
mac-tag-autocomplete-source = "autocompleteUrl"
mac-tag-autocomplete-query = "q"
mac-tag-autocomplete-selected = "tagAutocompleteSelected"
mac-tag-autocomplete-value = "id"
mac-tag-autocomplete-label = "name"
mac-tag-autocomplete-placeholder = "tagAutocompletePlaceholder"
mac-tag-autocomplete-model = "tagAutocompleteModel"
/>
Example with autocomplete disabled
<mac-tag-autocomplete
mac-tag-autocomplete-selected = "tagAutocompleteDisabledSelected"
mac-tag-autocomplete-placeholder = "tagAutocompletePlaceholder"
mac-tag-autocomplete-value = ""
mac-tag-autocomplete-label = ""
mac-tag-autocomplete-disabled = "true"
/>