angular-ui-typeahead

Angular UI bootstrap - show dropdown on typeahead-no-results

让人想犯罪 __ 提交于 2020-01-03 10:05:28
问题 tryng to get a dropdown when no result on typeahead but, the drop down menu dosen't show view <div class="dropdown"> <div class="form-group"> <input placeholder="Vælg kunde" type="text" ng-model="customer" typeahead-editable="false" uib-typeahead="customer as customer.customer for customer in customers | filter:$viewValue | limitTo:8" class="form-control" typeahead-popup-template-url="customPopupTemplate.html" typeahead-min-length="0" typeahead-no-results="noResults"> </div> <div ng-if=

UI Bootstrap Typeahead not returning async values

隐身守侯 提交于 2020-01-03 05:12:17
问题 I am trying to do an autocomplete search using UI Bootstrap Typeahead to select a category from a database. I have set up an example database with 4 categories, the final one will contain more than a thousand categories. When I start typing, the search results return 4 rows (so something must be working, because I tried to change the number of rows in the DB and the search result mirrors the total number of rows) but with no value. However, it doesn't matter what I write so it doesn't seem to

angular bootstrap typeahead not working with a dynamic list retrieved by ng-change

倾然丶 夕夏残阳落幕 提交于 2019-12-25 16:53:14
问题 I am working with typeahead directive in angular-bootstrap. My problem is when user change the input, I want to trigger a ng-change event to get the list from the server, then filter the results. After that I want to see the list to be populated with uib-typeahead. For that, I am using an array $scope.list to store the result from the server and then I pass it into uib-typeahead as <div class="input-group"> <input type="text" class="form-control" ng-model="asyncSelected" placeholder="Search

How to populate Angular UI Bootstrap Typeahead with newest $resource

跟風遠走 提交于 2019-12-19 03:08:32
问题 According to this Paweł Kozłowski's answer, Typeahead from AngularUI-Bootstrap should work when asynchronously obtaining popup items with $resource in newest Angular versions (I'm using 1.2.X). Plunk - Paweł's version - Typeahead with $http I guess I don't know how to use it properly (As a result I get an error in typeaheadHighlight directive's code - typeahead treats instantly returned Resource s as strings and tires to highlight them). Plunk - Typeahead with $resource I think the critical

Tyepahead search results misplaced with validation

只愿长相守 提交于 2019-12-13 21:07:51
问题 I am using a validation plug-in based on jQuery validation in my AngularJS app (which is built on top of a jQuery library). When I use ui bootstrap Typeahead with validation the search results are misplaced. Plunkr: http://plnkr.co/edit/ZYP58GxITghkTqE7PNHy HTML (help.html) <div class="form-group"> <label for="category">Category "{{formData.category}}"</label> <input class="form-control" type="text" name="category" id="category" placeholder="Search..." ng-model="formData.category" typeahead=

cannot navigate angular-ui boostrap typeahead with specific height with keyboard

戏子无情 提交于 2019-12-12 14:17:44
问题 So, I think it's more a bootsrap issue than angular-ui, but I spent 2 nights over this and I cannot find the light at the end of the tunnel. Here's the plunkr : http://plnkr.co/edit/n39LVjbHQzmcwGkk2dR1?p=preview Search for "x" and then try to go down using the arrow keys. Items will be selected, but they will not gain focus. Any ideas? 回答1: Here is a solution. I added another directive to the typeahead li element shouldFocus that watches for its active value to change. When it does it calls

angular typeahead filter: use html tags

自作多情 提交于 2019-12-12 04:36:41
问题 I'm using a filter with angular typeahead to append an extra item onto the typeahead suggestion list like so: app.filter('finalAppend', function($sce){ return function(array, value){ array.push({ name: $sce.trustAsHtml('Look for <b>' + value + '</b> in other shops'), type: 'good' }); return array; } }); I want to return html encoded string, but angular automatically sanitizes it. I tried using $sce as suggested, but it doesn't seem to work. Here's the plunkr: plunkr thanks in advance. 回答1: It

Wrapping angular typeAhead in separate directive

萝らか妹 提交于 2019-12-11 13:29:28
问题 My goal was to wrap angular-ui typeAhead directive into easily re-usable component, that could be used like this: <input my-person-lookup="myModel.personId" ></input> I've achieve this by writing my custom directive, and specifying static template for typeahead. Here is Plunker Now, I would like to build this template dynamically, and then compile it: var html = '<input type="text" ng-model="directiveModel.selectedPerson" typeahead=" p as p.name for p in people" typeahead-min-length="1"

Open AngularUI Bootstrap Typeahead Matches Results via Controller

十年热恋 提交于 2019-12-11 07:14:22
问题 Is there anyway to trigger opening the match results on a typeahead input text box from the controller? use case: user goes to https://example.com/search/searchText controller of page sets the input text to "searchText" (ng-model) on initialization trigger showing the typeahead results from the controller I can only seem to get the typeahead results, obviously, while typing in the input text box. 回答1: I got it to work in a couple ways, but both require changes to ui-bootstrap. I suppose I

UI Bootstrap Typeahead: Make input invalid if no option is selected

寵の児 提交于 2019-12-10 20:54:18
问题 I am using a validation plug-in based on jQuery validation in my AngularJS app (which is built on top of a jQuery library). The category input (search field) is required. But if I fill it with text and don't select a matching search I can still submit it because there is text in the search field. How can I make it invalid if no option is selected? Plunkr: http://plnkr.co/edit/ZYP58GxITghkTqE7PNHy HTML (help.html) <div class="form-group"> <label for="category">Category "{{formData.category}}"<