winjs / angular-winjs

Project to smooth the AngularJS/WinJS interaction
Other
126 stars 46 forks source link

AutoSuggestBox doesn't set the selected value #94

Open NCC1701M opened 8 years ago

NCC1701M commented 8 years ago

When I enter something in a AutoSuggestBox the list is shown but when I select a value (by mouse or keyboard) the selected value is not set. It shows only the entered pattern.

<win-auto-suggest-box query-text="orderCtrl.variant" on-suggestions-requested="orderCtrl.requestSuggestions('variant', $event)"></win-auto-suggest-box>

Here the controller function:

function requestSuggestions(type, eventObject) {
      var queryText = eventObject.detail.queryText;

      if (!queryText || queryText.length === 0) {
         return;
      }

      eventObject.detail.setPromise($http.get("/api/suggestions/" + type + "/" + queryText).then(function(response) {
         var suggestionCollection = eventObject.detail.searchSuggestionCollection;
         angular.forEach(response.data, function(item) {
            suggestionCollection.appendQuerySuggestion(item);
         });
      }).catch(function(err) {
         console.log(err);
      }));
   }
NCC1701M commented 8 years ago

Is this project still alive????