Angucomplete-alt: getting a text value when it does not match

Angucomplete-alt works great for me when you try to force the user to a predefined selection of objects.

But if I do not want to force the user to one of these objects, if instead I want the user to enter free text and only have additions as sentences, then how can I access the text input field?

For example, I have a hidden field that orders the string value of the Angucomplete-alt field to send to the database. Like this:

<input type="hidden" name="dance[start_type]"
       ng-value="IS_THERE_A_SELECTION ? selectedStartType.originalObject.name : JUST_TELL_ME_THE_STRING_THEY_TYPED"/> 

What expressions should be used for IS_THERE_A_SELECTION and JUST_TELL_ME_THE_STRING_THEY_TYPED?

+4
source share
2

. , , angucomplete-alt. ng- .

, ,

searchStr: '=ngModel',

.

focusIn:"&"

ng- angucomplete-alt.

+7

, , , .

$scope.localSearch = function(str) {
    ...
}

readme.md , "str" ​​ - . .

0

Source: https://habr.com/ru/post/1627879/


All Articles