angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.3k stars 6.74k forks source link

Typeahead won't allow non-search result values #6712

Closed robeverett closed 5 years ago

robeverett commented 5 years ago

I can only enter a value which matches one of the search results.

How do I allow the user to enter their own text (and not just select from the results ?) How do I prevent the "No Matching Records" popping up, is there an event I can handle for that ?

formatMatches = (value: any) => value.EmployeeName; engageIDs = (value: any) => value.EngageID;

    searchEmployee = (text$: Observable<string>) =>
      text$.pipe(
        debounceTime(200),
        distinctUntilChanged(),
        tap(() => this.searching = true),
        switchMap(term => 
          this.engageService.search(term).pipe(
            tap(() => this.searchFailed = false),
            catchError(() => {
              this.searchFailed = true;
              return of([]);
            }))
          ),
          tap(() => this.searching = false)        
      )
icfantv commented 5 years ago

Closing this as this project is no longer being maintained, per the README and the ISSUE_TEMPLATE.